liurenjie1024 commented on issue #2021:
URL: https://github.com/apache/iceberg-rust/issues/2021#issuecomment-3752540051
Hi, @CTTY Thanks for raising this discussion, it took me some time to
understand how the register external table work in datafusion. I think we would
ask user to use it as sth mixing option A and option B:
```
let df_session: SessionState = ...;
let iceberg_catalog: Arc<Catalog> = ...;
df_session.register_catalog("c_name", icebrg_catalog_provider);
df_session. table_factories_mut("ICECBERG", new
IcebergTableProviderFactory(iceberg_catalog));
df.sql("CREAT EXTERNAL TABLE c_name.default.tbl STORED AS ICEBERG ...");
```
With this approach, we could provide a fully functional iceberg integration.
But the caveat with this approach is that, we can't stop users from registering
table to non-iceberg catalog, e.g. ```CREATE EXTERNAL TABLE
delta_catalog.default.tbl STORE AS ICEBERG ...)```. This is caused by
datafusion's design.
Also we need to add a check in `IcebergSchemaProvider::register_table` to
refuse non iceberg table.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]