Sruhvx-jpg opened a new pull request, #27363:
URL: https://github.com/apache/datafusion/pull/27363

   ## Which issue does this PR close?
   
   Follow-up to #27317. Closes #27314.
   
   ## Rationale for this change
   
   In `ListingTable` and `ListingTableConfig`, several fields lacked accessors:
   1. `ListingTable::file_schema`: Currently `table.schema()` returns the 
combined table schema (file schema + Hive partition columns). Callers had no 
way to inspect or retrieve the raw physical file schema directly, requiring 
manual partition-column filtering workarounds as seen in #27314.
   2. `ListingTable::cache`: `with_cache` setter existed, but there was no 
getter to inspect or forward the attached `FileStatisticsCache`.
   3. `ListingTableConfig::expr_adapter_factory`: `with_expr_adapter_factory` 
setter existed, but the field was `pub(crate)` without a public getter.
   
   ## What changes are included in this PR?
   
   1. Added `pub fn file_schema(&self) -> &SchemaRef` to `ListingTable`.
   2. Added `pub fn cache(&self) -> Option<&Arc<FileStatisticsCache>>` to 
`ListingTable`.
   3. Added `pub fn expr_adapter_factory(&self) -> Option<&Arc<dyn 
PhysicalExprAdapterFactory>>` to `ListingTableConfig`.
   4. Added unit tests for all three accessors in `table.rs` and `config.rs`.
   
   ## Are these changes tested?
   
   Yes, tested via unit tests in `datafusion-catalog-listing`:
   - `test_file_schema`
   - `test_cache`
   - `test_config_expr_adapter_factory`
   
   Verified with `cargo fmt` and `cargo clippy`.


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