dirtysalt commented on a change in pull request #670:
URL: https://github.com/apache/orc/pull/670#discussion_r601173060



##########
File path: site/specification/ORCv1.md
##########
@@ -1297,7 +1297,7 @@ in a bloom filter is as follows:
   * position = combinedHash % m
 6. Set the position in bit set. The LSB 6 bits identifies the long index
    within bitset and bit position within the long uses little endian order.
-  * bitset[position >>> 6] \|= (1L << position);
+  * bitset[position >> 6] \|= (1L << (position & 0x3f));

Review comment:
       Thanks.  Here is the corresponding code 
https://github.com/apache/orc/blob/master/c%2B%2B/src/BloomFilter.cc#L47. 
   
   The code is correct, but the documentation is not. The code is to use `% 64` 
which has the same effect as `& 0x3f`. 
   
   ```
     constexpr uint64_t BITS_OF_LONG = 64;
     constexpr uint8_t  SHIFT_6_BITS = 6;
     void BitSet::set(uint64_t index) {
       mData[index >> SHIFT_6_BITS] |= (1ULL << (index % BITS_OF_LONG));
     }
   ```




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


Reply via email to