jpountz commented on a change in pull request #730: LUCENE-8868: New storing
strategy for BKD tree leaves with low cardinality
URL: https://github.com/apache/lucene-solr/pull/730#discussion_r296589276
##########
File path: lucene/core/src/java/org/apache/lucene/util/bkd/BKDReader.java
##########
@@ -480,12 +487,62 @@ void visitDocValues(int[] commonPrefixLengths, byte[]
scratchDataPackedValue, by
int compressedDim = readCompressedDim(in);
if (compressedDim == -1) {
- visitRawDocValues(commonPrefixLengths, scratchDataPackedValue, in,
docIDs, count, visitor);
+ visitUniqueRawDocValues(scratchDataPackedValue, docIDs, count, visitor);
} else {
visitCompressedDocValues(commonPrefixLengths, scratchDataPackedValue,
in, docIDs, count, visitor, compressedDim);
}
}
+ void visitDocValuesWithCardinality(int[] commonPrefixLengths, byte[]
scratchDataPackedValue, byte[] scratchMinIndexPackedValue, byte[]
scratchMaxIndexPackedValue,
+ IndexInput in, int[] docIDs, int count,
IntersectVisitor visitor) throws IOException {
+
+ readCommonPrefixes(commonPrefixLengths, scratchDataPackedValue, in);
+ int compressedDim = readCompressedDim(in);
+ if (compressedDim == -1) {
+ //all values are the same
+ visitor.grow(count);
+ visitUniqueRawDocValues(scratchDataPackedValue, docIDs, count, visitor);
+ } else {
+ if (numIndexDims != 1 && version >=
BKDWriter.VERSION_LEAF_STORES_BOUNDS) {
+ byte[] minPackedValue = scratchMinIndexPackedValue;
+ System.arraycopy(scratchDataPackedValue, 0, minPackedValue, 0,
packedIndexBytesLength);
+ byte[] maxPackedValue = scratchMaxIndexPackedValue;
+ //Copy common prefixes before reading adjusted
+ // box
Review comment:
move end of comment to the previous line?
----------------------------------------------------------------
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]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]