NoahKusaba opened a new pull request, #110:
URL: https://github.com/apache/datafusion-iceberg/pull/110

   ## Which issue does this PR close?
   
   - None. This is the first of a few small cleanups based on the public API 
feedback in #67 and #48.
   
   ## Rationale for this change
   
   - `IcebergStaticTableProvider::try_new_from_table` and 
`try_new_from_table_snapshot` are `async`, but neither awaits anything. Callers 
have to be in an async context and `.await` a constructor that does no I/O.
   - `IcebergMetadataTableProvider::schema()` converts the metadata table's 
schema to Arrow on every call and `unwrap()`s the result. A provider that can't 
produce its schema should fail when it's built, not panic during planning.
   - Error messages and docs still use the provider's old name, 
`IcebergTableProvider`, from before #49 renamed it. `AGENTS.md` also refers to 
`IcebergTableScan`, a `table/` directory and an EXPLAIN format that no longer 
exist.
   
   ## What changes are included in this PR?
   
   - `IcebergStaticTableProvider::try_new_from_table` and 
`try_new_from_table_snapshot` are now synchronous.
   - `IcebergMetadataTableProvider::new` is replaced by `try_new`, which 
returns a `Result`. It converts the schema once and stores it, and `schema()` 
returns the stored schema.
   - The `insert_into` errors of both providers, the factory and static 
provider docs, and a comment in `predicate.rs` now use 
`IcebergCatalogTableProvider` / `IcebergStaticTableProvider`.
   - `AGENTS.md` now refers to `IcebergDataSource`, `table_provider/`, and the 
current `DataSourceExec: format=iceberg, ...` EXPLAIN format.
   
   ## Are there any user-facing changes?
   
   Yes, two small breaking changes:
   
   - Drop the `.await` after 
`IcebergStaticTableProvider::try_new_from_table(..)` and 
`try_new_from_table_snapshot(..)`.
   - Replace `IcebergMetadataTableProvider::new(table, type)` with 
`IcebergMetadataTableProvider::try_new(table, type)?`.
   
   The `insert_into` error message for non-append inserts now names 
`IcebergCatalogTableProvider`.
   
   ## Are these changes tested?
   
   Yes, by the existing tests, updated for the new signatures:
   
   - The static provider unit tests and `test_plan_nodes_are_inspectable` 
construct the providers without `.await`.
   - `test_plan_nodes_are_inspectable` rebuilds the metadata scan through 
`IcebergMetadataTableProvider::try_new`.
   - The unit test for rejected insert modes checks the new error message in 
full.
   


-- 
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]

Reply via email to