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

feat: add lz4_raw support for arrow1 #466

Merged
merged 4 commits into from
Feb 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 2 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,9 @@ brotli = ["parquet/brotli"]
gzip = ["parquet/flate2"]
snappy = ["parquet/snap"]
zstd = ["parquet/zstd", "dep:zstd"]
# LZ4 not yet supported on parquet crate
# lz4 = ["parquet2?/lz4_flex"]
lz4 = ["parquet/lz4"]

all_compressions = ["brotli", "gzip", "snappy", "zstd"] # "lz4"
all_compressions = ["brotli", "gzip", "snappy", "zstd", "lz4"]

# Full list of available features
full = [
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -198,8 +198,8 @@ The Parquet specification permits several compression codecs. This library curre
- [x] Gzip
- [x] Brotli
- [x] ZSTD
- [x] LZ4_RAW
- [ ] LZ4 (deprecated)
- [x] LZ4_RAW. Supported in `arrow2` only.

LZ4 support in Parquet is a bit messy. As described [here](https://github.com/apache/parquet-format/blob/54e53e5d7794d383529dd30746378f19a12afd58/Compression.md), there are _two_ LZ4 compression options in Parquet (as of version 2.9.0). The original version `LZ4` is now deprecated; it used an undocumented framing scheme which made interoperability difficult. The specification now reads:

Expand Down Expand Up @@ -259,7 +259,7 @@ By default, `arrow`, `all_compressions`, `reader`, and `writer` features are ena
- `gzip`: Activate Gzip compression.
- `snappy`: Activate Snappy compression.
- `zstd`: Activate ZSTD compression.
- `lz4`: Activate LZ4_RAW compression (only applies to the `arrow2` endpoints).
- `lz4`: Activate LZ4_RAW compression.
- `debug`: Expose the `setPanicHook` function for better error messages for Rust panics.

## Node <20
Expand Down
3 changes: 1 addition & 2 deletions src/writer_properties.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ impl From<Compression> for parquet::basic::Compression {
Compression::BROTLI => parquet::basic::Compression::BROTLI(BrotliLevel::default()),
Compression::LZ4 => parquet::basic::Compression::LZ4,
Compression::ZSTD => parquet::basic::Compression::ZSTD(ZstdLevel::default()),
// TODO: fix this. Though LZ4 isn't supported in arrow1 for wasm anyways
Compression::LZ4_RAW => parquet::basic::Compression::LZ4,
Compression::LZ4_RAW => parquet::basic::Compression::LZ4_RAW,
}
}
}
Expand Down
Loading