peterxcli opened a new pull request, #19071:
URL: https://github.com/apache/datafusion/pull/19071

   ## Which issue does this PR close?
   
   - Closes https://github.com/apache/datafusion/issues/16944
   
   ## Rationale for this change
   
   - Logical plans can include file sources. To serialize/deserialize logical 
plans (e.g., to ship between processes, store/replay), DataFusion needs to 
encode the file format configuration (CSV/JSON/Parquet/Arrow).
   - Previously, the default codec didn’t implement try_encode_file_format / 
try_decode_file_format (it returned “not implemented”). This change makes the 
default codec able to handle the common formats out-of-the-box.
   
   ## What changes are included in this PR?
   
   - New `try_decode_file_format(&self, buf: &[u8], ctx: &SessionContext) -> 
Result<Arc<dyn FileFormatFactory>>` in `DefaultLogicalExtensionCodec`
   - New `try_encode_file_format(&self, buf: &mut Vec<u8>, node: Arc<dyn 
FileFormatFactory>) -> Result<()>` in `DefaultLogicalExtensionCodec`
   
   ## Are these changes tested?
   
   - direct test:
     - tests added inside 
`datafusion/proto/tests/cases/roundtrip_logical_plan.rs`
   - indirect test:
     - `roundtrip_arrow_scan` — Uses `logical_plan_to_bytes()` and 
`logical_plan_from_bytes()`, which use `DefaultLogicalExtensionCodec`, so it 
exercises Arrow file format encoding/decoding.
     - `roundtrip_custom_listing_tables` — Uses the default codec and may 
involve file formats.
   
   ## Are there any user-facing changes?
   
   Yes, makes the default codec able to handle the common formats 
out-of-the-box.


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