Skip to content

Commit 9f8bde5

Browse files
committed
ES|QL: No plain strings in Literal elastic#129399
1 parent 51f940e commit 9f8bde5

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/optimizer/rules/logical/ReplaceAggregateNestedExpressionWithEval.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
package org.elasticsearch.xpack.esql.optimizer.rules.logical;
99

10+
import org.elasticsearch.common.lucene.BytesRefs;
1011
import org.elasticsearch.xpack.esql.core.expression.Alias;
1112
import org.elasticsearch.xpack.esql.core.expression.Attribute;
1213
import org.elasticsearch.xpack.esql.core.expression.Expression;
@@ -112,7 +113,7 @@ protected LogicalPlan rule(Aggregate aggregate) {
112113

113114
// Try to convert the format pattern to a minimal time interval
114115
// This optimization attempts to simplify date formatting to DATE_TRUNC operations
115-
Literal interval = formatToMinimalInterval((String) format.value(), g.source());
116+
Literal interval = formatToMinimalInterval(BytesRefs.toString(format.value()), g.source());
116117
// If we can optimize the format to use DATE_TRUNC
117118
if (interval != null) {
118119
// Create a new DateTrunc operation with the optimized interval

0 commit comments

Comments
 (0)