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

Support decimal as a RecordFieldType

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Patch Available
    • Major
    • Resolution: Unresolved
    • None
    • None
    • Core Framework
    • None

    Description

      I'm building a custom RecordReader to import financial data from extracts in a custom file format. Everything works except when converting from Avro Schema to RecordSchema, the decimal information is silently converted to double causing the reader to interpret the transaction values as doubles.

      It would be nice if we had native support for Decimals as now I have to read the values as string and then run a spark job to convert them to doubles.

      My suggestion would be:

      1. Add a RecordFieldType.DECIMAL value
      2. Add a DecimalDataType class that has `getPrecision()` and `getScale()` getters
      3. Add a `RecordFieldType.getDecimalDataType(precision, scale)` method to create an instance of the RecordFieldType.DECIMAL value

      Attachments

        Activity

          People

            Unassigned Unassigned
            korir Gideon Korir
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Time Tracking

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