abhishekagarwal87 commented on code in PR #15999:
URL: https://github.com/apache/druid/pull/15999#discussion_r1510918837
##########
processing/src/main/java/org/apache/druid/data/input/Rows.java:
##########
@@ -186,6 +174,18 @@ public static Number objectToNumber(
return (Number) NullHandling.defaultValueForType(outputType != null ?
outputType : ValueType.LONG);
}
}
+
+ if (outputType == null || asNumber == null) {
+ return asNumber;
+ } else if (outputType == ValueType.LONG) {
+ return asNumber.longValue();
+ } else if (outputType == ValueType.FLOAT) {
+ return asNumber.floatValue();
+ } else if (outputType == ValueType.DOUBLE) {
+ return asNumber.doubleValue();
+ } else {
+ throw new ISE("Cannot read number as type[%s]", outputType);
Review Comment:
```suggestion
throw new ISE("Cannot read number as type[%s] for field [%s]",
outputType, name);
```
--
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]