-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Avro: Add variant readers and writers #12457
base: main
Are you sure you want to change the base?
Conversation
9aad1b4
to
b18a880
Compare
core/src/main/java/org/apache/iceberg/data/avro/DataWriter.java
Outdated
Show resolved
Hide resolved
core/src/main/java/org/apache/iceberg/avro/GenericAvroReader.java
Outdated
Show resolved
Hide resolved
case ARRAY: | ||
// for now, generate an object instead of an array | ||
case OBJECT: | ||
ShreddedObject object = Variants.object(metadata); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems we only have fully shredded objects here. Should we add partial shredded objects?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This produces a variant in memory, not a serialized variant. The writer is free to serialize however it chooses, although this is currently not intended to exercise shredding paths that need records to have a more stable structure in order to make sense.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
This adds readers and writers for Variants in Avro. Avro generics, Iceberg generics, and the internal data model are supported.
Variant values are tested using
RandomVariants
to extend random data generation.