xanderbailey commented on code in PR #2887:
URL: https://github.com/apache/iceberg-rust/pull/2887#discussion_r3713619874
##########
crates/iceberg/src/writer/file_writer/parquet_writer.rs:
##########
@@ -110,6 +111,40 @@ impl ParquetWriterBuilder {
}
}
+fn parquet_compression(codec: CompressionCodec) -> Result<Compression> {
+ let compression = match codec {
+ CompressionCodec::None => Compression::UNCOMPRESSED,
+ CompressionCodec::Snappy => Compression::SNAPPY,
+ CompressionCodec::Lzo => Compression::LZO,
+ CompressionCodec::Lz4 => Compression::LZ4,
+ CompressionCodec::Lz4Raw => Compression::LZ4_RAW,
+ CompressionCodec::Zstd(level) => {
+ let level =
+ ZstdLevel::try_new(level as i32).map_err(|e|
invalid_level_error("zstd", e))?;
+ Compression::ZSTD(level)
+ }
+ CompressionCodec::Gzip(level) => {
+ let level =
+ GzipLevel::try_new(level as u32).map_err(|e|
invalid_level_error("gzip", e))?;
+ Compression::GZIP(level)
+ }
+ CompressionCodec::Brotli(level) => {
+ let level =
+ BrotliLevel::try_new(level as u32).map_err(|e|
invalid_level_error("brotli", e))?;
+ Compression::BROTLI(level)
+ }
+ };
+ Ok(compression)
+}
Review Comment:
Conversion between our Codec and parquet types is still done locally, it
didn't make sense to me to leak the parquet types into the codec mod.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]