tpalfy commented on a change in pull request #4104: NIFI-7159
URL: https://github.com/apache/nifi/pull/4104#discussion_r389052612
##########
File path:
nifi-commons/nifi-record/src/main/java/org/apache/nifi/serialization/record/util/DataTypeUtils.java
##########
@@ -1237,10 +1246,38 @@ public static Double toDouble(final Object value,
final String fieldName) {
throw new IllegalTypeConversionException("Cannot convert value [" +
value + "] of type " + value.getClass() + " to Double for field " + fieldName);
}
+ public static BigDecimal toBigDecimal(final Object value, final String
fieldName) {
+ if (value == null) {
Review comment:
Shouldn't we cover all the `Number` cases?
I think `new BigDecimal(value.toString());` might be enough.
(Can't think of an example where the string representation of a `Number`
would not be good.)
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services