Skip to content

Commit 99392c6

Browse files
committed
Keep me
1 parent 5e75a46 commit 99392c6

File tree

1 file changed

+3
-0
lines changed
  • x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/string

1 file changed

+3
-0
lines changed

x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/string/Length.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,9 @@ public ExpressionEvaluator.Factory toEvaluator(ToEvaluator toEvaluator) {
100100
@Override
101101
public PushedBlockLoaderExpression tryPushToFieldLoading(SearchStats stats) {
102102
if (field instanceof FieldAttribute f) {
103+
if (stats.hasDocValues(f.fieldName()) == false) {
104+
return null;
105+
}
103106
BlockLoaderWarnings warnings = new BlockLoaderWarnings(DriverContext.WarningsMode.COLLECT, source());
104107
return new PushedBlockLoaderExpression(f, new BlockLoaderFunctionConfig.Named("LENGTH", warnings));
105108
}

0 commit comments

Comments
 (0)