Repository navigation
Conversation
When ReaderOptions::projection is not set, the Avro and Parquet readers now derive the read schema from the file schema instead of failing. Closes apache#514
The Parquet reader in libiceberg_bundle now calls FromArrowSchema, which lives in libiceberg, so shared builds failed to link it. Mark it ICEBERG_EXPORT like ToArrowSchema. Signed-off-by: Vincent <1729065730@qq.com>
Author
|
The shared-library builds failed to link because the Parquet reader in (AI-assisted reply.) |
This branch has not been deployed
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.
Closes #514.
What
ReaderOptions::projectionis no longer required for the Avro and Parquet readers. When it is not set, the reader derives the read schema from the file schema and reads all fields.FromAvroSchema(), which converts an Avro schema written by Iceberg (withfield-id,element-id,key-id/value-idand themaplogical type for non-string keys) back into an IcebergSchema. Sanitized field names are restored fromiceberg-field-name.FromParquetSchema(), which builds the schema from theSchemaManifest. Since it runs afterApplyNameMapping, files without field IDs work when a name mapping is provided. Fields that still have no ID (or lists/maps whose element/key/value has no ID) are skipped, because they can't be read by ID anyway. A file with neither field IDs nor a name mapping still fails as before.ParquetReadernow builds theSchemaManifestonce inOpen()and uses it for both the schema derivation and the projection.Tests
FromAvroSchemaTest: primitive types, nested struct/list/map (string and non-string keys), sanitized names, missing field ID and unsupported types.ParquetSchemaConversionTest: round trip throughToParquetSchemafor list and large_list, and conversion with a partial name mapping.avro_test,parquet_test,schema_test,data_test,scan_test,manifest_test,table_testandarrow_testpass locally.This PR was written with the help of an AI coding assistant. I reviewed the changes and tests myself.