https://github.com/apache/spark
Revision 427148f86e28576ec5eb9799edff4d8106758082 authored by wangzixuan.wzxuan on 27 June 2022, 02:05:08 UTC, committed by Sean Owen on 27 June 2022, 02:05:15 UTC
…oDeserializer

### What changes were proposed in this pull request?
Add ByteBuffer#rewind after ByteBuffer#get in AvroDeserializer.

### Why are the changes needed?
- HeapBuffer.get(bytes) puts the data from POS to the end into bytes, and sets POS as the end. The next call will return empty bytes.
- The second call of AvroDeserializer will return an InternalRow with empty binary column when avro record has binary column.

### Does this PR introduce _any_ user-facing change?
No.

### How was this patch tested?
Add ut in AvroCatalystDataConversionSuite.

Closes #36973 from wzx140/avro-fix.

Authored-by: wangzixuan.wzxuan <wangzixuan.wzxuan@bytedance.com>
Signed-off-by: Sean Owen <srowen@gmail.com>
(cherry picked from commit 558b395880673ec45bf9514c98983e50e21d9398)
Signed-off-by: Sean Owen <srowen@gmail.com>
1 parent fc6a664
History
Tip revision: 427148f86e28576ec5eb9799edff4d8106758082 authored by wangzixuan.wzxuan on 27 June 2022, 02:05:08 UTC
[SPARK-39575][AVRO] add ByteBuffer#rewind after ByteBuffer#get in Avr…
Tip revision: 427148f

README.md

back to top