-
Notifications
You must be signed in to change notification settings - Fork 280
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.
|
||
from pyiceberg.avro.codecs.bzip2 import BZip2Codec | ||
from pyiceberg.avro.codecs.codec import Codec | ||
from pyiceberg.avro.codecs.deflate import DeflateCodec | ||
from pyiceberg.avro.codecs.snappy_codec import SnappyCodec | ||
from pyiceberg.avro.codecs.zstandard_codec import ZStandardCodec | ||
|
||
KNOWN_CODECS: Dict[str, Optional[Type[Codec]]] = { | ||
AvroCompressionCodec: TypeAlias = Literal["null", "bzip2", "snappy", "zstandard", "deflate"] |
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.
In other places in the project we use zstd instead of zstandard. What do you think about using zstd?
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.
Hey @ndrluis that's a great catch! We should use zstd
instead. Avro uses zstandard
, that's why I copied it here, but it is actually wrong.
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.
keep in min that this TypeAlias
is called AvroCompressionCodec
, so it should actually use zstandard
instead of zstd
, but I've fixed it for Iceberg. LMKWYT
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 :)