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

Returning NULL instead of array-index-out-of-bound error in CSV files

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Invalid
    • Affects Version/s: None
    • Fix Version/s: 0.5.0
    • Labels:
      None
    • Environment:

      SqlLine in Linux and C# in Windows

      Description

      When an out of bound column in a CSV file is queried, for example,

      SELECT columns[12] as column_12 FROM `dfs`.`root`.`./sneaky.csv`;

      the result is a column with all null values:

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

      column_12

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

      null
      null
      null
      null
      null

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

      However, it makes more sense to return an error instead because the file has only 10 columns.

      The file content:

      someDirectoryFoo,true,false,false,100,root,root,"2013-10-11T14:31:58.000-0700","2013-10-11T14:31:58.000-0700","rw-rr-."
      someDirectoryBar,true,false,false,100,root,root,"2013-10-11T14:31:58.000-0700","2013-10-11T14:31:58.000-0700","rw-rr-."
      aFile,false,true,false,1234,root,root,"2013-10-11T14:31:58.000-0700","2013-10-11T14:31:58.000-0700","rw-rr-."
      anotherFile,false,true,false,2345,root,root,"2012-11-11T14:31:58.000-0700","2012-11-11T14:31:58.000-0700","rw-rr-."
      yetAnotherFile,false,true,false,3456,root,root,"2011-11-11T14:31:58.000-0700","2012-11-11T14:31:58.000-0700","rw-rr-."

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              alzarei Alexander Zarei
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: