Parquet: accept zstd compression level 0 and negative levels in `ZstdLevel`

オープン 初心者向け
#11,545 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
72/100
issue の種類
機能追加
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
rust
領域
data

調査の方向性

レベルの上下限は parquet/src/compression.rs の定数 MINIMUM_LEVEL と MAXIMUM_LEVEL で、ZstdLevel::try_new がこれを検証します。まずこの検証処理と、その隣にある既存のテストを読んでください。zstd::compression_level_range() は const ではないため、チェックは実行時に行う必要があります。上下限をどのように取得するかを決めてください。完了の条件は、zstd の範囲内にあるレベル 0 と負の値が変更されずに受け入れられて渡されること、範囲外の値は引き続き拒否されること、そして圧縮関連のテストがすべて通ることです。

索引モデルが issue の本文から書いたものです。

説明

enhancement parquet

Is your feature request related to a problem or challenge? Please describe what you are trying to do.

parquet::basic::ZstdLevel::try_new accepts only levels 1 to 22 (MINIMUM_LEVEL = 1, MAXIMUM_LEVEL = 22 in parquet/src/compression.rs). zstd itself also accepts:

  • level 0, which means its default level (ZSTD_CLEVEL_DEFAULT, 3)
  • negative "fast" levels, down to ZSTD_minCLevel(), which trade compression ratio for speed

parquet-java (through zstd-jni) accepts both, so a writer that wants to honor a table's configured zstd level cannot do so with parquet-rs. Apache Iceberg tables, for example, can set write.parquet.compression-level to 0 or a negative value, and iceberg-java writes them; DataFusion Comet's native Iceberg writer has to fall back to the JVM writer for those tables.

Describe the solution you'd like

Let ZstdLevel accept the full range the linked zstd library supports (zstd::compression_level_range()), including 0 and negative levels, and pass them through to the encoder unchanged.

Describe alternatives you've considered

Callers can map 0 to 3 themselves, but there is no equivalent for the negative levels.

Additional context

compression_level_range() is not const, which is presumably why the bounds are hard-coded today.

主要言語
Rust
スター
3.7k
フォーク
1.4k
平均マージ
2日 7時間
マージ済み PR(30日)
292

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

apache/arrow-rs のほかの issue

apache/arrow-rs の issue をすべて見る

似ている issue

Rust の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。