Uploaded image for project: 'Apache Drill'
  1. Apache Drill
  2. DRILL-5549

SELECT * against a CSV file with empty headers produces error

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 1.10.0
    • None
    • Storage - Text & CSV
    • None

    Description

      See DRILL-5548 for background. This test is very similar except that the input file has a single blank line. Since the CSV plugin is set up to read headers, this represents a non-empty file, with no headers and no data.

      Again use a star query:

      SELECT * FROM `dfs.data.emptyHeader.csv`
      

      The result this time is somewhat different:

      org.apache.drill.common.exceptions.UserRemoteException: 
      SYSTEM ERROR: HeaderError: The file must define at least one header.
      

      If we fix the issue in DRILL-5548 (empty file), we should use the same solution for a file with an empty header.

      Suppose the file was not entirely empty, suppose it was:

      1:
      2: fred
      3: barney
      

      (Note: line numbers shown to force display of blank line...)

      Here, we have an empty header, but we have data. We can't know that we have data while reading the header. While this is a pathological case, and an invalid CSV file, this second case does suggest that the right solution to the two empty cases is to use the special columns array when the header is empty. This will allow Drill to gracefully handle the case above for a file with no header but with data.

      Attachments

        Activity

          People

            Unassigned Unassigned
            paul-rogers Paul Rogers
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: