Skip to content

feat: make DefaultLogicalExtensionCodec support serialisation of buil…#20638

Open
Acfboy wants to merge 2 commits intoapache:mainfrom
Acfboy:support-logicalextension-serialisztion
Open

feat: make DefaultLogicalExtensionCodec support serialisation of buil…#20638
Acfboy wants to merge 2 commits intoapache:mainfrom
Acfboy:support-logicalextension-serialisztion

Conversation

@Acfboy
Copy link
Contributor

@Acfboy Acfboy commented Mar 2, 2026

Which issue does this PR close?

Rationale for this change

Currently, the LogicalExtensionCodec implementation for DefaultLogicalExtensionCodec leaves try_decode_file_format / try_encode_file_format unimplemented (returning "not implemented" errors). However, the actual serialization logic for built-in file formats — arrow, parquet, csv, and json— already exists in their respective codec implementations. All we need to do is tag which format is being used, and delegate to the corresponding format-specific codec to handle the data.

What changes are included in this PR?

Added a FileFormatKind enum and a FileFormatProto message to datafusion.proto to identify the file format type during transmission. Implemented try_decode_file_format and try_encode_file_format for DefaultLogicalExtensionCodec, which dispatch serialization/deserialization to the corresponding format-specific codec based on the format kind. Note that Avro is not covered because the upstream repository has not yet implemented the corresponding Avro codec, so Avro support is not functional at this time.

Are these changes tested?

Yes. Roundtrip tests are included for csv, json, parquet, and arrow.

Are there any user-facing changes?

@github-actions github-actions bot added the proto Related to proto crate label Mar 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

proto Related to proto crate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

make DefaultLogicalExtensionCodec support serialisation of build in file formats

1 participant