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

   ## Which issue does this PR close?
   
   Closes #27314.
   
   ## Rationale for this change
   
   In `ListingTable`, swapping or wrapping the `PhysicalExprAdapterFactory` of 
an existing table currently requires manually unpacking individual fields to 
construct a `ListingTableConfig` and calling `ListingTable::try_new(config)`. 
This is verbose, discards runtime table state (such as file statistics cache, 
table definitions, constraints, and column defaults), and redundantly 
re-evaluates schemas and fingerprints.
   
   While `ListingTableConfig` provides `with_expr_adapter_factory`, 
`ListingTable` was missing the matching getter and setter after 
`SchemaAdapterFactory` was replaced by `PhysicalExprAdapterFactory`.
   
   ## What changes are included in this PR?
   
   1. Added `pub fn expr_adapter_factory(&self) -> Option<&Arc<dyn 
PhysicalExprAdapterFactory>>` to `ListingTable`.
   2. Added `pub fn with_expr_adapter_factory(mut self, expr_adapter_factory: 
Arc<dyn PhysicalExprAdapterFactory>) -> Self` to `ListingTable`.
   3. Added unit test in `datafusion/catalog-listing/src/table.rs` verifying 
adapter assignment, retrieval, and replacement on cloned tables without 
mutating the original table.
   
   ## Are these changes tested?
   
   Yes, tested via `test_with_expr_adapter_factory` in 
`datafusion-catalog-listing`. Verified clean formatting (`cargo fmt`) and zero 
clippy warnings.


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