jbonofre opened a new pull request, #1480:
URL: https://github.com/apache/arrow-java/pull/1480

   ## What's Changed
   
   Follow-up to #1231. `ClobConsumer` reads a CLOB in chunks of 256 characters 
and encodes each chunk to UTF-8 on its own, so a character outside the BMP 
split between two chunks was encoded as `??`.
   
   - A chunk that ends with a high surrogate, while characters remain, now 
leaves it for the next chunk, so the pair is encoded together.
   - The read position advances by the length of the chunk instead of the 
requested size. The shorter chunk needs this, and it also stops skipping 
characters when a driver returns fewer than requested.
   - An empty chunk before the end of the CLOB throws an `SQLException` instead 
of looping forever.
   
   `ClobConsumerTest` covers emojis across chunk boundaries for both consumers. 
The test fails without the fix: 255 `a` followed by 😀 read back as 257 bytes 
instead of 259.
   
   This changes other lines of `ClobConsumer` than #1479, and the two branches 
merge cleanly.
   
   Closes #1478.
   


-- 
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]

Reply via email to