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

Provide row number and sheet name if ExcelReader throws exception when it fails to convert a value

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • None
    • 1.28.0, 2.0.0
    • None
    • None

    Description

      While testing NIFI-13726 it was noticed when using the ExcelReader configured with the "Use Starting Row" strategy that the file failed but the message was

      org.apache.nifi.processor.exception.ProcessException: Could not parse incoming data
             ....
      Caused by: org.apache.nifi.serialization.MalformedRecordException: Read next Record from Excel XLSX failed
              at org.apache.nifi.excel.ExcelRecordReader.nextRecord(ExcelRecordReader.java:86)
              at org.apache.nifi.serialization.RecordReader.nextRecord(RecordReader.java:50)
              at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
              at java.base/java.lang.reflect.Method.invoke(Method.java:580)
             ....
      Caused by: java.lang.NumberFormatException: For input string: ""
              at java.base/java.lang.NumberFormatException.forInputString(NumberFormatException.java:67)
              at java.base/java.lang.Integer.parseInt(Integer.java:672)
              at java.base/java.lang.Integer.parseInt(Integer.java:778)
              at org.apache.nifi.serialization.record.util.DataTypeUtils.toInteger(DataTypeUtils.java:1468)
              at org.apache.nifi.serialization.record.util.DataTypeUtils.convertType(DataTypeUtils.java:211)
              at org.apache.nifi.serialization.record.util.DataTypeUtils.convertType(DataTypeUtils.java:174)
      

      which does not point to which row the ExcelReader failed on. It would be helpful to include in the exception message which row the reader failed on.

      Attachments

        Issue Links

          Activity

            People

              dstiegli1 Daniel Stieglitz
              dstiegli1 Daniel Stieglitz
              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 - 10m
                  10m