dirtysalt commented on a change in pull request #586:
URL: https://github.com/apache/orc/pull/586#discussion_r608297071
##########
File path: java/core/src/java/org/apache/orc/impl/RunLengthIntegerWriterV2.java
##########
@@ -286,7 +285,9 @@ private void writePatchedBaseValues() throws IOException {
// find the number of bytes required for base and shift it by 5 bits
// to accommodate patch width. The additional bit is used to store the sign
// of the base value.
- final int baseWidth = utils.findClosestNumBits(min) + 1;
+ int baseBitsNum = utils.findClosestNumBits(min);
Review comment:
The root cause here is because we add 1 here, so `baseWidth` ranges from
2 to 65, and `baseBytes` ranges from 0 to 8 which does not fit into 3 bits.
##########
File path: java/core/src/java/org/apache/orc/impl/RunLengthIntegerWriterV2.java
##########
@@ -286,7 +285,9 @@ private void writePatchedBaseValues() throws IOException {
// find the number of bytes required for base and shift it by 5 bits
// to accommodate patch width. The additional bit is used to store the sign
// of the base value.
- final int baseWidth = utils.findClosestNumBits(min) + 1;
+ int baseBitsNum = utils.findClosestNumBits(min);
Review comment:
The root cause here is because we add 1 here, so `baseWidth` ranges from
2 to 65, and `baseBytes` ranges from 0 to 8 which does not fit into 3 bits.
Thanks for your fixing.
--
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]