TSFenwick commented on code in PR #16529:
URL: https://github.com/apache/druid/pull/16529#discussion_r1628629431
##########
processing/src/main/java/org/apache/druid/segment/DimensionHandlerUtils.java:
##########
@@ -330,25 +329,67 @@ public static Long convertObjectToLong(@Nullable Object
valObj, boolean reportPa
} else if (valObj instanceof String) {
Long ret = DimensionHandlerUtils.getExactLongFromDecimalString((String)
valObj);
if (reportParseExceptions && ret == null) {
- throw new ParseException((String) valObj, "could not convert value
[%s] to long", valObj);
+ final String message = (objectKey != null) ?
StringUtils.nonStrictFormat(
+ "could not convert value [%s] to long for dimension [%s]",
+ valObj,
+ objectKey
+ ) : StringUtils.nonStrictFormat(
+ "could not convert value [%s] to long",
+ valObj
+ );
+ throw new ParseException((String) valObj, message);
}
return ret;
} else if (valObj instanceof List) {
- throw new ParseException(
- valObj.getClass().toString(),
+ final String message = (objectKey != null) ? StringUtils.nonStrictFormat(
+ "Could not ingest value [%s] as long for dimension [%s]. A long
column cannot have multiple values in the same row.",
+ valObj,
+ objectKey
+ ) : StringUtils.nonStrictFormat(
"Could not ingest value %s as long. A long column cannot have
multiple values in the same row.",
Review Comment:
should the list value format string have the `[]`'s around it? it would end
up looking like [[1,2,3]]. its confusing to me as a developer to know if it
should have a square bracket or not depending on the type...
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]