Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,10 @@ public static ElementType toElementType(DataType dataType, MappedFieldType.Field
case LONG, DATETIME, DATE_NANOS, UNSIGNED_LONG, COUNTER_LONG -> ElementType.LONG;
case INTEGER, COUNTER_INTEGER -> ElementType.INT;
case DOUBLE, COUNTER_DOUBLE -> ElementType.DOUBLE;
<<<<<<< HEAD
=======
case FLOAT, COUNTER_FLOAT -> ElementType.FLOAT;
>>>>>>> db1a3e23e2b (Without comments. Eveything passes with passing `false` (default).)
// unsupported fields are passed through as a BytesRef
case KEYWORD, TEXT, IP, SOURCE, VERSION, UNSUPPORTED -> ElementType.BYTES_REF;
case NULL -> ElementType.NULL;
Expand All @@ -331,7 +335,7 @@ public static ElementType toElementType(DataType dataType, MappedFieldType.Field
case PARTIAL_AGG -> ElementType.COMPOSITE;
case AGGREGATE_METRIC_DOUBLE -> ElementType.AGGREGATE_METRIC_DOUBLE;
case DENSE_VECTOR -> ElementType.FLOAT;
case SHORT, BYTE, DATE_PERIOD, TIME_DURATION, OBJECT, FLOAT, HALF_FLOAT, SCALED_FLOAT -> throw EsqlIllegalArgumentException
case SHORT, BYTE, DATE_PERIOD, TIME_DURATION, OBJECT, HALF_FLOAT, SCALED_FLOAT -> throw EsqlIllegalArgumentException
.illegalDataType(dataType);
};
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1175,6 +1175,10 @@ static Page valuesToPage(BlockFactory blockFactory, List<ColumnInfoImpl> columns
case LONG, COUNTER_LONG -> ((LongBlock.Builder) builder).appendLong(((Number) value).longValue());
case INTEGER, COUNTER_INTEGER -> ((IntBlock.Builder) builder).appendInt(((Number) value).intValue());
case DOUBLE, COUNTER_DOUBLE -> ((DoubleBlock.Builder) builder).appendDouble(((Number) value).doubleValue());
<<<<<<< HEAD
=======
case FLOAT, COUNTER_FLOAT -> ((FloatBlock.Builder) builder).appendFloat(((Number) value).floatValue());
>>>>>>> db1a3e23e2b (Without comments. Eveything passes with passing `false` (default).)
case KEYWORD, TEXT -> ((BytesRefBlock.Builder) builder).appendBytesRef(new BytesRef(value.toString()));
case UNSUPPORTED -> ((BytesRefBlock.Builder) builder).appendNull();
case IP -> ((BytesRefBlock.Builder) builder).appendBytesRef(stringToIP(value.toString()));
Expand Down Expand Up @@ -1227,6 +1231,9 @@ static Page valuesToPage(BlockFactory blockFactory, List<ColumnInfoImpl> columns
}
floatBuilder.endPositionEntry();
}
default -> throw new IllegalArgumentException(
"Unsupported data type [" + dataTypes.get(c) + "] for value [" + value + "] at column " + c
);
}
}
}
Expand Down