You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
datafusion: Create table provider for a snapshot. (#707)
* datafusion: Create table provider for a snapshot.
The Iceberg table provider allows querying an Iceberg table via
datafusion. The initial implementation only allowed querying the latest
snapshot of the table. It sometimes useful to query a specific snapshot
(time travel). This commit adds this capability. It adds a new method
(`try_new_from_table_snapshot`) that creates a provider for a specific
table snapshot.
All existing APIs should work as before.
Signed-off-by: Leonid Ryzhyk <[email protected]>
* datafusion: use Snapshot::schema, not schema_id().
Apply @liurenjie1024's suggestion: use `Snapshot::schema` instead of retrieving
the schema directly by id (which can be missing in the snapshot).
Signed-off-by: Leonid Ryzhyk <[email protected]>
---------
Signed-off-by: Leonid Ryzhyk <[email protected]>
Co-authored-by: Leonid Ryzhyk <[email protected]>
let schema = Arc::new(schema_to_arrow_schema(table.metadata().current_schema())?);
70
-
Ok(IcebergTableProvider{ table, schema })
80
+
Ok(IcebergTableProvider{
81
+
table,
82
+
snapshot_id:None,
83
+
schema,
84
+
})
85
+
}
86
+
87
+
/// Asynchronously tries to construct a new [`IcebergTableProvider`]
88
+
/// using a specific snapshot of the given table. Can be used to create a table provider from an existing table regardless of the catalog implementation.
0 commit comments