apache / apache/parquet-java

Impossible to read thrift object from parquet file if it has List<Enum> field that was removed from thrift schema.

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

説明

If thrift class has a field with type List ParquetReader makes list's elements type as enum (type id = 16) but it has to make it Int32.

What happens is all fields that have field type as enum in thrift schema file in java class have field type as Int32. Same is true for List fields if list's elements are enum.

But when ParquetReader creates an object it uses type enum for list's elements instead of Int32.
Because of this fact we have an issue. We can not remove list field if it has enum elements. If we remove field like this from schema file but it will present in parquet file, when ParquetReader reads this field it tries to skip it because this field is not in the schema and it calls method TProtocolUtil.skip method with type = 15 for list and then it calls same method for each list element with type 16 for enum but TProtocolUtil.skip doesn't have this type in switch-case and it is not skipping list elements and because of this it throws exception later when it tries to skip List end.

**Reporter**: [Andrei Stankevich](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=andrei.stankevich)

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

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

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

調査の方向性

Start with ParquetReader's handling of removed thrift fields and the TProtocolUtil.skip entry point described in the report. Trace how List elements with enum type id 16 are skipped when reading an older parquet file. Done means a removed List field is skipped without an exception while the remaining fields are read correctly.

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

評価

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

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

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