apache / apache/parquet-java

FilteredRecordReader skips rows it shouldn't for schema with optional columns

オープン
#1,730 コメント 6 件 リアクション 0 件 担当者 0 名 GitHub で見る
Component: Java Component: Parquet Priority: Blocker Type: bug
主要言語
Java
スター
3.1k
フォーク
1.6k
平均マージ
3日 12時間
マージ済み PR(30日)
33

説明

When using UnboundRecordFilter with nested AND/OR filters over OPTIONAL columns, there seems to be a case with a mismatch between the current record's column value and the value read during filtering.

The structure of my filter predicate that results in incorrect filtering is: (x && (y || z))

When I step through it with a debugger I can see that the value being read from the ColumnReader inside my Predicate is different than the value for that row.

Looking deeper there seems to be a buffer with dictionary keys in RunLenghBitPackingHybridDecoder (I am using RLE). There are only two different keys in this array, [0,1], whereas my optional column has three different values, [null,0,1]. If I had a column with values 5,10,10,null,10, and keys 0 -> 5 and 1 -> 10, the buffer would hold 0,1,1,1,0, and in the case that it reads the last row, would return 0 -> 5.

So it seems that nothing is keeping track of where nulls appear.

Hope someone can take a look, as it is a blocker for my project.

**Environment**: Linux, Java7/Java8
**Reporter**: [Steven Mellinger](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=stevemel)
#### Related issues:
- [filter2 API performance regression](https://github.com/apache/parquet-java/issues/1583) (relates to)

**Note**: *This issue was originally created as [PARQUET-182](https://issues.apache.org/jira/browse/PARQUET-182). Please see the [migration documentation](https://issues.apache.org/jira/browse/PARQUET-2502) for further details.*

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

調査の方向性

まず、FilteredRecordReader、UnboundRecordFilter、ColumnReader を通じて、ネストされた (x \u0026\u0026 (y || z)) 述語を追跡します。null、0、1 を含むオプション列を使って RunLenghBitPackingHybridDecoder を調査し、デコードされた値を行位置と比較します。フィルタリングで正しい行が返され、回帰テストのカバレッジで null の位置が保持されれば完了です。

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

評価

技術スタック
java
領域
data-engineering
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
35/100

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

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