Expose arrow schema on async avro reader#9533
Closed
mzabaluev-flarion wants to merge 3 commits intoapache:mainfrom
Closed
Expose arrow schema on async avro reader#9533mzabaluev-flarion wants to merge 3 commits intoapache:mainfrom
mzabaluev-flarion wants to merge 3 commits intoapache:mainfrom
Conversation
Add a schema method to obtain the Arrow schema from the async Avro reader.
Tests on alltypes_plain.avro
Add metadata on fields of nested records and the list type, so that the expected schema matches the one produced by the reader. Add a test reading nested_records.avro to verify the schema exposed by the reader.
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.
Rationale for this change
Exposes the Arrow schema produced by the async Avro file reader, similarly to the
schemamethod on the synchronous reader.This allows an application to prepare casting or other schema transformations with no need to fetch the first record batch to learn the produced Arrow schema. Since the async reader only parses OCF content for the moment, the schema does not change from batch to batch.
What changes are included in this PR?
The
schemamethod forAsyncAvroFileReaderexposes the Arrow schema of record batches that are produced by the reader.Are these changes tested?
Added tests verifying that the returned schema matches the expected.
Are there any user-facing changes?
Added a
schemamethod toAsyncAvroFileReader.