feat: make DefaultLogicalExtensionCodec support serialisation of buil…#20638
Open
Acfboy wants to merge 2 commits intoapache:mainfrom
Open
feat: make DefaultLogicalExtensionCodec support serialisation of buil…#20638Acfboy wants to merge 2 commits intoapache:mainfrom
Acfboy wants to merge 2 commits intoapache:mainfrom
Conversation
…d in file formats
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Which issue does this PR close?
Rationale for this change
Currently, the
LogicalExtensionCodecimplementation forDefaultLogicalExtensionCodecleavestry_decode_file_format/try_encode_file_formatunimplemented (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
FileFormatKindenum and aFileFormatProtomessage todatafusion.prototo identify the file format type during transmission. Implementedtry_decode_file_formatandtry_encode_file_formatforDefaultLogicalExtensionCodec, 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?