dragonknightk opened a new pull request, #1520: URL: https://github.com/apache/arrow-java/pull/1520
## What's Changed AvroStringConsumer read string fields with Decoder.readBytes. That works with BinaryDecoder, because the binary encoding for string and bytes is the same. ResolvingDecoder checks the reader schema and throws AvroTypeException: "Attempt to process a bytes when a string was expected." ValidatingDecoder throws the same error, and this change fixes both. The consumer now calls Decoder.readString and copies the Utf8 bytes into the VarCharVector, reusing the Utf8 instance the same way the old code reused a ByteBuffer. The new test reads "v1", an empty string and a non-ASCII string through a ResolvingDecoder and checks the vector holds the same values; the empty string after a longer value and the multi-byte characters check that only the valid bytes of the reused Utf8 are copied. Closes #832. ## AI Disclosure Human-led contribution. Grok Bot, working for dragonknightk, assisted with this change, including the code, tests, and description. All submitted content was reviewed by a human before submission. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
