[HUDI-4285] add ByteBuffer#rewind after ByteBuffer#get in AvroDeseria… (#5907)
* [HUDI-4285] add ByteBuffer#rewind after ByteBuffer#get in AvroDeserializer * add ut Co-authored-by: wangzixuan.wzxuan <wangzixuan.wzxuan@bytedance.com>
This commit is contained in:
@@ -181,6 +181,8 @@ private[sql] class AvroDeserializer(rootAvroType: Schema,
|
||||
case b: ByteBuffer =>
|
||||
val bytes = new Array[Byte](b.remaining)
|
||||
b.get(bytes)
|
||||
// Do not forget to reset the position
|
||||
b.rewind()
|
||||
bytes
|
||||
case b: Array[Byte] => b
|
||||
case other =>
|
||||
|
||||
Reference in New Issue
Block a user