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

Improve Record type inference between integer and floating-point fields

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 1.18.0
    • Extensions
    • None

    Description

      When we configure a Record Reader to infer the type of an object, and it finds two values, one of which is an integer (or short, long, etc.) and the other is a floating point number (float, double, etc) the inferred type becomes a CHOICE between an int and a double, for example.

      But this is really not a great inference. It is common to see JSON or CSV data, for example, where numbers are truncated if they have no decimals (i.e., 5.0 becomes 5). It doesn't really make sense to then write this as a union between an int and a double, as the real type of the field is a double.

      We should improve the inference logic to allow float and doubles to encapsulate byte/short/int/long values.

      Attachments

        Issue Links

          Activity

            People

              markap14 Mark Payne
              markap14 Mark Payne
              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 - 40m
                  40m