kbendick opened a new pull request #1334:
URL: https://github.com/apache/iceberg/pull/1334


   There are some warnings that violate our Error Prone linter that we use. 
This PR closes out https://github.com/apache/iceberg/issues/1292
   
   I have removed the ByteBuffer ones by tracking them down and ensuring that 
they could be suppressed according to the warnings given on the Error Prone 
documentation.
   
   According to the documentation on the warning found here 
https://errorprone.info/bugpattern/ByteBufferBackingArray, if the ByteBuffer 
was locally with ByteBuffer.wrap or Bytebuffer.allocate then you're good to 
call `.array()` and assume that this is an on-heap byte array.
   
   There was one case that I do not believe solved this solution. It's in the 
PR, and perhaps somebody with more Orc knowledge than I have can be of 
assistance, but the ByteBufferWriter doesn't really tell you much about the 
ByteBufer that's being written into the Orc file and the user needs to grab the 
underlying backing array (or generate it fif the data is off heao). Thinking 
about vectorized orc readers in spark as an example with off heap memory 
enabled, this would likely not be the case that these ByteBuffers were 
allocated with backing arrays (spark.unsafe might also need to be true, but my 
point is that I can see a probable situation where the precondition that this 
ByteBuffer is on heap is not met. So I decided to check if it hasArray, which 
is an inexpensive methiod, and then copied the ByteBuffer into a bytep[] if 
this were not the case.


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

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