File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed
x-pack/plugin/esql/compute/src/main/java/org/elasticsearch/compute/lucene/read Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change 2828 * Additionally, this implementation can collect complete value blocks.
2929 */
3030public class TSIDOrdinalsBuilder implements BlockLoader .TSIDOrdinalsBuilder , Releasable , Block .Builder {
31+
32+ private static final int TSID_SIZE_GUESS = 2 + 16 + 16 + 4 * 8 ;
33+
3134 private final BlockFactory blockFactory ;
3235 private final SortedDocValues docValues ;
3336 private final long [] ords ;
@@ -83,7 +86,7 @@ BytesRefBlock buildOrdinal() {
8386 for (int i = 0 ; i < count ; i ++) {
8487 newOrds [i ] = Math .toIntExact (ords [i ]) - minOrd ;
8588 }
86- try (BytesRefVector .Builder bytesBuilder = blockFactory .newBytesRefVectorBuilder (valueCount )) {
89+ try (BytesRefVector .Builder bytesBuilder = blockFactory .newBytesRefVectorBuilder (valueCount * TSID_SIZE_GUESS )) {
8790 for (int ord = minOrd ; ord <= maxOrd ; ord ++) {
8891 bytesBuilder .appendBytesRef (docValues .lookupOrd (ord ));
8992 }
You can’t perform that action at this time.
0 commit comments