Skip to content
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

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

rdblue
Copy link
Contributor

@rdblue rdblue commented Mar 5, 2025

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.

@rdblue rdblue force-pushed the avro-support-variant branch from 9aad1b4 to b18a880 Compare March 5, 2025 23:14
case ARRAY:
// for now, generate an object instead of an array
case OBJECT:
ShreddedObject object = Variants.object(metadata);
Copy link
Contributor

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?

Copy link
Contributor Author

@rdblue rdblue Mar 6, 2025

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.

Copy link
Contributor

@aihuaxu aihuaxu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants