clintropolis opened a new pull request #12150:
URL: https://github.com/apache/druid/pull/12150


   ### Description
   This PR fixes a bug introduced in #11888 for the ARRAY type strategy write 
method, where the size tracking of remaining buffer space had a silly math bug 
that made size tracking go wildly wrong the longer the array was. I was 
incorrectly subtracting the total so far bytes written for the whole array, 
rather than only the bytes for each element written, so it "used" up the space 
far far quicker than the actual number of bytes written 😛 
   
   I added a test, which fails prior to the changes in this PR, that writes an 
array that is nearly the size of the test buffer to ensure that size tracking 
allows the full use of the buffer.
   
   I also fixed up a couple of spots that mutate buffer position in 
`NullableTypeStrategy` that should've been wrapped in a try..finally, so now 
they are.
   
   This PR has:
   - [x] been self-reviewed.
   - [x] added unit tests or modified existing tests to cover new code paths, 
ensuring the threshold for [code 
coverage](https://github.com/apache/druid/blob/master/dev/code-review/code-coverage.md)
 is met.
   - [x] been tested in a test Druid cluster.
   


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



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to