Skip to content

Commit 3d82d86

Browse files
committed
Remove unnecessary change to BlockUtis now that we create float elements when casting
1 parent fb3bec7 commit 3d82d86

File tree

1 file changed

+1
-2
lines changed
  • x-pack/plugin/esql/compute/src/main/java/org/elasticsearch/compute/data

1 file changed

+1
-2
lines changed

x-pack/plugin/esql/compute/src/main/java/org/elasticsearch/compute/data/BlockUtils.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -213,8 +213,7 @@ public static void appendValue(Block.Builder builder, Object val, ElementType ty
213213
case LONG -> ((LongBlock.Builder) builder).appendLong((Long) val);
214214
case INT -> ((IntBlock.Builder) builder).appendInt((Integer) val);
215215
case BYTES_REF -> ((BytesRefBlock.Builder) builder).appendBytesRef(toBytesRef(val));
216-
// Dense_vector blocks may be created from double values when retrieved from literals
217-
case FLOAT -> ((FloatBlock.Builder) builder).appendFloat(((Number) val).floatValue());
216+
case FLOAT -> ((FloatBlock.Builder) builder).appendFloat(((Float) val));
218217
case DOUBLE -> ((DoubleBlock.Builder) builder).appendDouble((Double) val);
219218
case BOOLEAN -> ((BooleanBlock.Builder) builder).appendBoolean((Boolean) val);
220219
default -> throw new UnsupportedOperationException("unsupported element type [" + type + "]");

0 commit comments

Comments
 (0)