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

Add More information about exceptions from record readers/writers

    XMLWordPrintableJSON

Details

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

    Description

      When using record readers and writers i ran into a problem where  i tried to give it a CSV with the same header twice, i.e something like

      ------------------------------------------

      header1,header2,header1

      a,b,c

      ------------------------------------------

       (obviously not real data)

      When the reader tried to parse the flowfile as records it threw this error: "Failed to read Header line from CSV"

      Which is not very indicative, when i went ahead and debugged the source code i could see the real error is: 

      java.lang.IllegalArgumentException: The header contains a duplicate name: "header1" in [header1, header2, header1]

      (Pictures are provided)

      This is a case i ran into recently.

      I also have another case where tried to read an avro file which has a '#' (hashtag) character in one of the headers, which is illegal in the avro schema defenition.

      But the error i got there was : "failed to parse incoming data",

      And again, when i debugged the code i found the real error

      What the main point is to give a more indicative error message for record readers / writers, which not only gives the error itself but its cause

      I could probably look up many more reasons readers / writers could fail and they will not give a good error message, but i believe these 2 are fine as an example 

      Attachments

        1. image-2019-03-18-21-47-16-888.png
          260 kB
          Nimrod Avni
        2. image-2019-03-18-21-46-22-468.png
          98 kB
          Nimrod Avni

        Issue Links

          Activity

            People

              hondawei HondaWei
              Max Kelada Nimrod Avni
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:

                Time Tracking

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