Fix latent casting bug in BKDWriter (#11907)

This commit is contained in:
Benjamin Trent 2022-11-08 09:55:07 -05:00 committed by GitHub
parent 682e5c94e8
commit f9c26ed501
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

View File

@ -137,6 +137,8 @@ Bug Fixes
* GITHUB#11807: Don't rewrite queries in unified highlighter. (Alan Woodward)
* GITHUB#11907: Fix latent casting bugs in BKDWriter. (Ben Trent)
Optimizations
---------------------
* GITHUB#11738: Optimize MultiTermQueryConstantScoreWrapper when a term is present that matches all

View File

@ -515,7 +515,7 @@ public class BKDWriter implements Closeable {
checkMaxLeafNodeCount(numLeaves);
final byte[] splitPackedValues = new byte[numSplits * config.bytesPerDim];
final byte[] splitPackedValues = new byte[Math.multiplyExact(numSplits, config.bytesPerDim)];
final byte[] splitDimensionValues = new byte[numSplits];
final long[] leafBlockFPs = new long[numLeaves];
@ -946,7 +946,7 @@ public class BKDWriter implements Closeable {
// Indexed by nodeID, but first (root) nodeID is 1. We do 1+ because the lead byte at each
// recursion says which dim we split on.
byte[] splitPackedValues = new byte[Math.toIntExact(numSplits * config.bytesPerDim)];
byte[] splitPackedValues = new byte[Math.multiplyExact(numSplits, config.bytesPerDim)];
byte[] splitDimensionValues = new byte[numSplits];
// +1 because leaf count is power of 2 (e.g. 8), and innerNodeCount is power of 2 minus 1 (e.g.