Conversation
2f8a09a to
fa8d8c5
Compare
|
Thanks, @nastra! Looks good to me. |
So this is as intended The code is a bit complicated but a description would be interleavedBytes[interleaveByte] |= // if the target bit isn't set it
(columnsBinary[sourceColumn][sourceByte] & 1 << sourceBit) >>> sourceBit // Get the bit we are checking and move it all the way into the 1's place
<< interleaveBit; // Move the bit back into our target positionSo (columnsBinary[sourceColumn][sourceByte] & 1 << sourceBit) Can only produce values between 0 and 128 (00000000), (00000001), (00000010), .... (10000000) Then Can only produce values between 0 and 1 then Can only produce values again between 0 and 128 Now if interleave bit or source bit were greater than 7 we would be in trouble but those are locked down |
|
thanks for the clarification @RussellSpitzer. I suppressed the warning for NarrowingCompoundAssignment in #5212 |
The only warning that is left is this one from
iceberg/core/src/main/java/org/apache/iceberg/util/ZOrderByteUtils.java
Lines 182 to 183 in 2f8a09a
which seems legit as we're doing a lossy cast that would fail compilation if I rewrite it (https://errorprone.info/bugpattern/NarrowingCompoundAssignment):