Enums are incorrectly handled by parquet-avro when using GenericRecords
- 主要言語
- Java
- スター
- 3.1k
- フォーク
- 1.6k
- 平均マージ
- 3日 12時間
- マージ済み PR(30日)
- 33
説明
It appears that enums are handled incorrectly when reading parquet as generic records.
Looking at the code:
https://github.com/apache/parquet-mr/blob/master/parquet-avro/src/main/java/org/apache/parquet/avro/AvroIndexedRecordConverter.java#L236-L238
FieldEnumConverter falls back to a string representation when it can't find the corresponding enum class. This is problematic when trying to read parquet files generically without specific records on the classpath because the records will no longer match the schema. I believe a more correct approach would be to wrap the enums in GenericData.EnumSymbol:
https://github.com/apache/avro/blob/master/lang/java/avro/src/main/java/org/apache/avro/generic/GenericData.java#L397
**Reporter**: [Igor Bernstein](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=igorbernstein)
**Note**: *This issue was originally created as [PARQUET-557](https://issues.apache.org/jira/browse/PARQUET-557). Please see the [migration documentation](https://issues.apache.org/jira/browse/PARQUET-2502) for further details.*
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
調査の方向性
parquet-avro/src/main/java/org/apache/parquet/avro/AvroIndexedRecordConverter.java の 236-238 行付近にある FieldEnumConverter のコードから始め、次に Avro の GenericData.java にある、参照されている GenericData.EnumSymbol の動作と比較します。generic-record の読み取りで enum のスキーマ表現が保持され、文字列にフォールバックしないことを確認してください。結果のレコードがスキーマと一致すれば issue は完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- java
- 領域
- data-engineering
- issue の種類
- バグ
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 活発さ
- 停滞
- 明瞭さ
- 明確に書かれている
- 初心者へのやさしさ
- 45/100