-
Notifications
You must be signed in to change notification settings - Fork 302
Add Avro compression #1976
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
base: main
Are you sure you want to change the base?
Add Avro compression #1976
Conversation
PyIceberg did not compress the Avro. This will make gzip/deflate the same as in Java.
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.
self._compression = self._transaction.table_metadata.properties.get( # type: ignore | ||
TableProperties.WRITE_AVRO_COMPRESSION, TableProperties.WRITE_AVRO_COMPRESSION_DEFAULT | ||
) |
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.
I think little things like table property parsing has gotten us unexpectedly in the past - would it be possible to add a few cases that demonstrate:
- that the newly written manifests now have the new default compression when a new snapshot is committed?
- and that newly written manifests respect a compression codec value when the property is set, when a new snapshot is committed?
I think this would help us add coverage for the new parameter both in property parsing and the simple logic here in update.snapshots
module in each functions
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.
That's a good point @sungwy, and indeed that caught us in the past. I've added the test that you suggested, let me know what you think 👍
Rationale for this change
PyIceberg did not compress the Avro. This will make gzip/deflate the same as in Java.
Are these changes tested?
Existing round-trip tests with FastAvro and Spark. Some tests are extended to both write compressed and uncompressed data.
Are there any user-facing changes?
Smaller and faster manifest files :)