Skip to content

Commit 85fb175

Browse files
authored
[ES|QL] Use Double.BYTES instead of Long in double encoder (#134964)
Caught this typo while investigating a bug. It works because Long.BYTES and Double.BYTES are both 8, but we probably should use Double for the double encoder.
1 parent 5695cbf commit 85fb175

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

x-pack/plugin/esql/compute/src/main/java/org/elasticsearch/compute/operator/topn/DefaultUnsortableTopNEncoder.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ public float decodeFloat(BytesRef bytes) {
143143
public void encodeDouble(double value, BreakingBytesRefBuilder bytesRefBuilder) {
144144
bytesRefBuilder.grow(bytesRefBuilder.length() + Double.BYTES);
145145
DOUBLE.set(bytesRefBuilder.bytes(), bytesRefBuilder.length(), value);
146-
bytesRefBuilder.setLength(bytesRefBuilder.length() + Long.BYTES);
146+
bytesRefBuilder.setLength(bytesRefBuilder.length() + Double.BYTES);
147147
}
148148

149149
@Override

0 commit comments

Comments
 (0)