Statistic and Filter need a mechanism to get customized comparator from high layer user
- 主要言語
- Java
- スター
- 3.1k
- フォーク
- 1.6k
- 平均マージ
- 3日 12時間
- マージ済み PR(30日)
- 33
説明
As discussed in HIVE-10254, we might need a customized comparator from high layer user for generating statistic when writing and applying filter when reading.
The problem is that (use Decimal type in Hive as an example):
Decimal in Hive is mapped to Binary in Parquet. When using predicate and statistic to filter values, comparing Binary values in Parquet cannot reflect the correct relationship of Decimal values in Hive. This type mapping causes 2 problems:
1. When writing Decimal column, Binary.compareTo() is used to judge and set the column statistic (min, max). The generated statistic value is not correct from a Decimal perspective.
2. When reading with Predicate (also Filter), in which the expected Decimal value is converted to Binary type, Binary.compareTo() is used to compare the expected value and column statistic value. They are Binary perspective, and also the result is not right.
We could add an interface for customized comparator, and high level user like Hive provides the comparator to Parquet, since Hive knows how to decode the binary to Decimal and compare. Then Parquet could switch between customized and original comparison method.
**Reporter**: [Dong Chen](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=dongc) / @dongc
**Assignee**: [Dong Chen](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=dongc) / @dongc
#### Related issues:
- [Parquet PPD support DECIMAL](https://issues.apache.org/jira/browse/HIVE-10254) (blocks)
**Note**: *This issue was originally created as [PARQUET-281](https://issues.apache.org/jira/browse/PARQUET-281). Please see the [migration documentation](https://issues.apache.org/jira/browse/PARQUET-2502) for further details.*
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
調査の方向性
まず、issueで説明されている書き込みの統計生成パスと読み取りの述語/フィルター比較パスを、Decimalの動作についてはHIVE-10254を使用して追跡します。既存の比較動作を変更せずに、高レベルのコンパレータを提供できる箇所を特定します。統計とフィルタリングの両方で、カスタム比較によってDecimal値が正しく順序付けられれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- java
- 領域
- data-engineering
- issue の種類
- 機能追加
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 25/100