Matt Burgess created NIFI-8368:
----------------------------------

             Summary: Avro decimal logical type fails if scale > precision
                 Key: NIFI-8368
                 URL: https://issues.apache.org/jira/browse/NIFI-8368
             Project: Apache NiFi
          Issue Type: Bug
          Components: Extensions
            Reporter: Matt Burgess


Normally the precision of a decimal number its its total number of significant 
digits, and scale is the number of decimal digits, meaning that precision is 
almost always a greater value than scale. 

Oracle is an example of an RDBMS where a decimal's scale value can be greater 
than its precision. From the Oracle documentation: "Scale can be greater than 
precision, most commonly when e notation is used. When scale is greater than 
precision, the precision specifies the maximum number of significant digits to 
the right of the decimal point. For example, a column defined as NUMBER(4,5) 
requires a zero for the first digit after the decimal point and rounds all 
values past the fifth digit after the decimal point."

Avro assumes decimals with scale larger than precision are invalid, causing 
errors in ExecuteSQL(Record) processors for example. If scale is larger than 
precision, we can assume that the scale value should be used as the precision.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to