Avro adapter: AvroNullableConsumer should use readIndex
- 主要言語
- Java
- スター
- 94
- フォーク
- 152
- 平均マージ
- 3日 16時間
- マージ済み PR(30日)
- 11
説明
### Describe the bug, including details regarding any error messages, version, and platform.
When using Avro's `ValidatingDecoder`, any schema with a nullable field fails with the following exception:
```
Exception in thread "main" org.apache.avro.AvroTypeException: Attempt to process a int when a union was expected.
at org.apache.avro.io.parsing.Parser.advance(Parser.java:91)
at org.apache.avro.io.ValidatingDecoder.readInt(ValidatingDecoder.java:81)
at org.apache.arrow.adapter.avro.consumers.AvroNullableConsumer.consume(AvroNullableConsumer.java:44)
```
Reason: `AvroNullableConsumer` uses `readInt` to read the index, but it should use `readIndex` instead. It's irrelevant in case of a `BinaryDecoder`, for example (`readIndex` is the same as `readInt`), but `ValidatingDecoder`s and any Decoders based on that have different logic.
コントリビューションガイド
調査の方向性
AvroNullableConsumer.consume の、スタックトレースで特定された readInt 呼び出しから開始し、Avro の decoder API および ValidatingDecoder の動作と比較してください。ValidatingDecoder を使用して nullable フィールドを、union-versus-int 例外なしで消費できれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- java
- 領域
- backend
- issue の種類
- バグ
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 活発さ
- 停滞
- 明瞭さ
- 明確に書かれている
- 初心者へのやさしさ
- 52/100