Parquet-Avro does not support field removal
- 主要言語
- Java
- スター
- 3.1k
- フォーク
- 1.6k
- 平均マージ
- 3日 12時間
- マージ済み PR(30日)
- 33
説明
Parquet avro does not support removal of fields, when used with the new compatibility layer:
Given a parquet file written with parquet avro at v1 and the following schema:
```Java
record FooBar {
long foo;
string bar;
}
```
And the following configuration settings:
```Java
job.getConfiguration.setBoolean(AvroReadSupport.AVRO_COMPATIBILITY, false)
AvroParquetInputFormat.setAvroReadSchema(job, avroReaderSchema)
```
A job fails when trying to read it using schema version v2:
```Java
record FooBar {
string bar;
}
```
With the error:
```Java
org.apache.parquet.io.InvalidRecordException: Parquet/Avro schema mismatch: Avro field 'foo' not found
at org.apache.parquet.avro.AvroRecordConverter.getAvroField(AvroRecordConverter.java:159)
```
It looks like because it sees the field in the original version it assumes the new version must expect it, but this case just means that the field was removed. Avro schema resolution dictates that you just ignore this field, since it is not relevant in the new version.
**Reporter**: [Thomas Omans](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=eggsby)
**Note**: *This issue was originally created as [PARQUET-465](https://issues.apache.org/jira/browse/PARQUET-465). Please see the [migration documentation](https://issues.apache.org/jira/browse/PARQUET-2502) for further details.*
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
調査の方向性
AvroRecordConverter.java:159 から始め、設定された Avro リーダースキーマが Parquet ファイルに存在するフィールドとどのように比較されるかを追跡してください。issue の互換性設定を使って v1 から v2 への読み取りを再現します。削除された foo フィールドが無視され、bar が InvalidRecordException なしで正常に読み取られれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- java
- 領域
- data-engineering
- issue の種類
- バグ
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 35/100