Skip to content

Commit 8e7a835

Browse files
committed
Add assertion to check correct type
1 parent d23998d commit 8e7a835

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,9 @@ public LuceneQueryExpressionEvaluator(BlockFactory blockFactory, ShardConfig[] s
5656
@Override
5757
public Block eval(Page page) {
5858
// Lucene based operators retrieve DocVectors as first block
59-
DocVector docs = page.<DocBlock>getBlock(0).asVector();
59+
Block block = page.getBlock(0);
60+
assert block instanceof DocBlock : "LuceneQueryExpressionEvaluator expects DocBlock as input";
61+
DocVector docs = (DocVector) block.asVector();
6062
try {
6163
if (docs.singleSegmentNonDecreasing()) {
6264
return evalSingleSegmentNonDecreasing(docs).asBlock();

0 commit comments

Comments
 (0)