Skip to content

Commit b31d5c6

Browse files
committed
Update BytesRef handling
1 parent 9661efe commit b31d5c6

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/planner/AbstractPhysicalOperationProviders.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.planner;
99

10+
import org.elasticsearch.common.lucene.BytesRefs;
1011
import org.elasticsearch.compute.aggregation.Aggregator;
1112
import org.elasticsearch.compute.aggregation.AggregatorFunctionSupplier;
1213
import org.elasticsearch.compute.aggregation.AggregatorMode;
@@ -235,7 +236,7 @@ private AttributeMap<BlockHash.TopNDef> buildAttributesToTopNDefMap(AbstractAggr
235236
}
236237

237238
Attribute attribute = (Attribute) orderEntry.child();
238-
int intLimit = stringToInt(((Literal) limit).value().toString());
239+
int intLimit = stringToInt(BytesRefs.toString(((Literal) limit).value()));
239240

240241
BlockHash.TopNDef topNDef = new BlockHash.TopNDef(
241242
i,

0 commit comments

Comments
 (0)