Xeinn commented on issue #4104: NIFI-7159 - Add support for some data types in various processors URL: https://github.com/apache/nifi/pull/4104#issuecomment-602161276 @MikeThomsen Hi Mike, Had a quick look at the unit tests and can see what you mean. Recall having a bit of debate with myself over how to handle this when initially implementing - there may be some scope for improvement. Basically we have two different areas of "precision & scale" A schema can define a type with precision and scale but then values manipulated from the records will also have a precision and scale. The DataType represented by DecimalDataType stores the schema defined precision and scale - but the values themselves, internally represented by the BigDecimal type take on the precision and scale of the value held. So a string of "100.00" assigned to a BigDecimal would have precision of 5 and scale of 2 I guess the question is do we want to enforce the schema defined precision and scale throughout the handling of values and where necessary truncate/round values so they adhere to the schema defined precision and scale?
---------------------------------------------------------------- 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
