Skip to content

Commit 276759a

Browse files
committed
Add comment
1 parent 9505aff commit 276759a

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

x-pack/plugin/esql/compute/src/main/java/org/elasticsearch/compute/lucene/read/SingletonOrdinalsBuilder.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,8 @@ private BytesRefBlock tryBuildConstantBlock() {
8686
try {
8787
bytes = blockFactory.newConstantBytesRefVector(v, 1);
8888
ordinals = blockFactory.newConstantIntVector(0, ords.length);
89+
// Ideally, we would return a ConstantBytesRefVector, but we return an ordinal constant block instead
90+
// to ensure ordinal optimizations are applied when constant optimization is not available.
8991
final var result = new OrdinalBytesRefBlock(ordinals.asBlock(), bytes);
9092
success = true;
9193
return result;

0 commit comments

Comments
 (0)