iceberg 0.10.2-x64-mingw-ucrt → 0.10.3-x64-mingw-ucrt

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/README.md CHANGED
@@ -82,9 +82,7 @@ Iceberg::MemoryCatalog.new(
82
82
  )
83
83
  ```
84
84
 
85
- ## Reference
86
-
87
- ### Namespaces
85
+ ## Namespaces
88
86
 
89
87
  List namespaces
90
88
 
@@ -122,7 +120,7 @@ Drop a namespace
122
120
  catalog.drop_namespace("main")
123
121
  ```
124
122
 
125
- ### Tables
123
+ ## Tables
126
124
 
127
125
  List tables
128
126
 
@@ -169,7 +167,7 @@ Drop a table
169
167
  catalog.drop_table("main.events")
170
168
  ```
171
169
 
172
- ### Static Tables
170
+ ## Static Tables
173
171
 
174
172
  Load a static table
175
173
 
Binary file
Binary file
Binary file
data/lib/iceberg/table.rb CHANGED
@@ -83,15 +83,28 @@ module Iceberg
83
83
  @table.properties
84
84
  end
85
85
 
86
- def to_polars(snapshot_id: nil, storage_options: nil)
86
+ def scan(snapshot_id: nil)
87
+ TableScan.new(@table.scan(snapshot_id), self)
88
+ end
89
+
90
+ def to_polars(snapshot_id: nil, storage_options: nil, _schema_changes: false)
87
91
  require "polars-df"
88
92
 
89
- files = @table.scan(snapshot_id).plan_files
93
+ # TODO always take this path in 0.2.0
94
+ if _schema_changes
95
+ return Polars.scan_iceberg(self, snapshot_id:, storage_options:)
96
+ end
97
+
98
+ scan = scan(snapshot_id:)
99
+ files = scan.plan_files
100
+
90
101
  if files.empty?
102
+ snapshot = scan.snapshot
103
+ scan_schema = snapshot ? schema_by_id(snapshot[:schema_id]) : current_schema
104
+
91
105
  # TODO improve
92
106
  schema =
93
- # TODO use schema from snapshot_id
94
- current_schema.fields.to_h do |field|
107
+ scan_schema.fields.to_h do |field|
95
108
  dtype =
96
109
  case field[:type]
97
110
  when "int"
@@ -122,16 +135,12 @@ module Iceberg
122
135
  .to_h { |v, i| [i, v[:deletes].map { |d| d[:file_path] }] }
123
136
  ]
124
137
 
125
- Polars.scan_parquet(
126
- sources,
138
+ scan_options = {
127
139
  storage_options: storage_options,
128
- # TODO
129
- # cast_options: Polars::ScanCastOptions._default_iceberg,
130
- # allow_missing_columns: true,
131
- # extra_columns: "ignore",
132
- # _column_mapping: column_mapping,
133
- _deletion_files: deletion_files
134
- )
140
+ _deletion_files: deletion_files,
141
+ }
142
+
143
+ Polars.scan_parquet(sources, **scan_options)
135
144
  end
136
145
  end
137
146
 
@@ -0,0 +1,18 @@
1
+ module Iceberg
2
+ class TableScan
3
+ attr_reader :table
4
+
5
+ def initialize(scan, table)
6
+ @scan = scan
7
+ @table = table
8
+ end
9
+
10
+ def plan_files
11
+ @scan.plan_files
12
+ end
13
+
14
+ def snapshot
15
+ @scan.snapshot
16
+ end
17
+ end
18
+ end
@@ -1,3 +1,3 @@
1
1
  module Iceberg
2
- VERSION = "0.10.2"
2
+ VERSION = "0.10.3"
3
3
  end
data/lib/iceberg.rb CHANGED
@@ -9,6 +9,7 @@ end
9
9
  require_relative "iceberg/catalog"
10
10
  require_relative "iceberg/schema"
11
11
  require_relative "iceberg/table"
12
+ require_relative "iceberg/table_scan"
12
13
  require_relative "iceberg/static_table"
13
14
  require_relative "iceberg/table_definition"
14
15
  require_relative "iceberg/version"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: iceberg
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.2
4
+ version: 0.10.3
5
5
  platform: x64-mingw-ucrt
6
6
  authors:
7
7
  - Andrew Kane
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-08-28 00:00:00.000000000 Z
11
+ date: 2025-10-16 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description:
14
14
  email: andrew@ankane.org
@@ -36,6 +36,7 @@ files:
36
36
  - lib/iceberg/static_table.rb
37
37
  - lib/iceberg/table.rb
38
38
  - lib/iceberg/table_definition.rb
39
+ - lib/iceberg/table_scan.rb
39
40
  - lib/iceberg/version.rb
40
41
  homepage: https://github.com/ankane/iceberg-ruby
41
42
  licenses: