Uploaded image for project: 'Flink'
  1. Flink
  2. FLINK-17818

CSV Reader with Pojo Type and no field names fails

    XMLWordPrintableJSON

Details

    Description

      When a file is read with a CSVReader and a POJO is specified and the filed names are not specified, the output is obviously not correct. The API is not throwing any error despite a null check inside the API. i.e.

      Preconditions.checkNotNull(pojoFields, "POJO fields must be specified (not null) if output type is a POJO.");
      

      The root cause of the problem is that the fieldNames argument is a variable argument and the variable is 'empty but not null' when not given any value. So, the check passes without failing.

      I am not sure if it is a feature of the API or an actual bug because there is a test checking the NPE when a null is passed.

      Attachments

        Issue Links

          Activity

            People

              damjad Danish Amjad
              damjad Danish Amjad
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

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