apache/druid · error · ParseException
Could not ingest value [%s] as float for dimension [%s]. A f
Error message
Could not ingest value [%s] as float for dimension [%s]. A float column cannot have multiple values in the same row.
What it means
convertObjectToFloat throws this ParseException when the value is a List: float columns are single-valued and multi-value inputs cannot be converted. Same restriction as for long columns but for float.
Source
Thrown at processing/src/main/java/org/apache/druid/segment/DimensionHandlerUtils.java:531
}
throw new ParseException((String) valObj, message);
}
return ret;
} else if (valObj instanceof List) {
final String message;
if (fieldName != null) {
message = StringUtils.nonStrictFormat(
"Could not ingest value [%s] as float for dimension [%s]. A float column cannot have multiple values in the same row.",
valObj,
fieldName
);
} else {
message = StringUtils.nonStrictFormat(
"Could not ingest value [%s] as float. A float column cannot have multiple values in the same row.",
valObj
);
}
throw new ParseException(
valObj.getClass().toString(),
message
);
} else {
final String message;
if (fieldName != null) {
message = StringUtils.nonStrictFormat(
"Could not convert value [%s] to float for dimension [%s]. Invalid type: [%s]",
valObj,
fieldName,
valObj.getClass()
);
} else {
message = StringUtils.nonStrictFormat(
"Could not convert value [%s] to float. Invalid type: [%s]",
valObj,
valObj.getClass()
);View on GitHub (pinned to 9b90983fd2)
Solutions
- Unnest/flatten the array before ingestion or take a single representative element.
- Declare the field as a multi-value string dimension instead of float if multi-valued data is legitimate.
- Transform: use the first element expression to guarantee scalar input.
- Reject/drop such rows upstream with input validation before ingestion.
Example fix
// before: "temps": [20.1, 21.3] for float column temps
// after: transform takes first value
"transforms": [{"type": "expression", "name": "temps", "expression": "CAST(temps[0] AS DOUBLE)"}] Defensive patterns
Strategy: validation
Validate before calling
boolean isScalar(Object v) {
return v == null || !(v instanceof List);
} Type guard
Float firstAsFloat(Object v) {
if (v instanceof List) {
List<?> l = (List<?>) v;
return l.isEmpty() ? null : asFloat(l.get(0));
}
return asFloat(v);
} Try / catch
try {
return DimensionHandlerUtils.convertObjectToFloat(value, fieldName);
} catch (ParseException e) {
if (e.getMessage().contains("multiple values")) {
return firstAsFloat(value); // or drop row
}
throw e;
} Prevention
- Unnest arrays before mapping to float columns
- Use multi-value string dimensions for legitimately multi-valued data
- Enforce scalar-only metric fields in producer validation
- Monitor for schema drift in JSON/Kafka feeds
When it happens
Trigger: A float-typed column receives a JSON array (e.g. [1.5, 2.5]) so the List branch of convertObjectToFloat throws; also reached via convertObjectToType.
Common situations: Metrics arriving as arrays from upstream sensors/events; schema drift where a field occasionally becomes multi-valued; JSON input with inconsistent nesting.
Understand the failure class
Background: "Invalid ... format", "must be in format X", "does not look like a ..." — invalid argument format errors across CLI tools and libraries — this error's family across 17 libraries.
Related errors
- Could not ingest value [%s] as long for dimension [%s]. A lo
- Could not ingest value [%s] as double for dimension [%s]. A
- Could not convert value [%s] to long.
- Could not convert value [%s] to long for dimension [%s]. Inv
- Could not convert value [%s] to float.
AI-assisted analysis of apache/druid@9b90983fd2 (2026-09-07).
Data as JSON: /api/errors/975e4155f45b6757.
Report an issue: GitHub.