Uploaded image for project: 'Apache NiFi'
  1. Apache NiFi
  2. NIFI-8368

Avro decimal logical type fails if scale > precision

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 1.14.0
    • Extensions
    • None

    Description

      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.

      Attachments

        Issue Links

          Activity

            People

              mattyb149 Matt Burgess
              mattyb149 Matt Burgess
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 50m
                  50m