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

csv extractHeader: fails on multiple empty columns

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.3.0
    • Fix Version/s: 1.4.0
    • Component/s: Storage - Text & CSV
    • Labels:
      None
    • Environment:

      Linux (RHEL 7.1)

      Description

      When the extractHeader feature is enabled and several columns in a row are empty, an exception occurs.

      csv_with_header.csvh
      name,num1,num2,num3
      hello,1,2,3
      hello,,,
      hello,1,2,3
      hello,1,2,3
      
      SELECT * FROM dfs.`/tmp/csv_with_header.csvh`;
      java.lang.NegativeArraySizeException
              at org.apache.drill.exec.vector.VarCharVector$Accessor.get(VarCharVector.java:450)
              at org.apache.drill.exec.vector.accessor.VarCharAccessor.getBytes(VarCharAccessor.java:125)
              at org.apache.drill.exec.vector.accessor.VarCharAccessor.getString(VarCharAccessor.java:146)
              at org.apache.drill.exec.vector.accessor.VarCharAccessor.getObject(VarCharAccessor.java:136)
              at org.apache.drill.exec.vector.accessor.VarCharAccessor.getObject(VarCharAccessor.java:94)
              at org.apache.drill.exec.vector.accessor.BoundCheckingAccessor.getObject(BoundCheckingAccessor.java:148)
              at org.apache.drill.jdbc.impl.TypeConvertingSqlAccessor.getObject(TypeConvertingSqlAccessor.java:795)
              at org.apache.drill.jdbc.impl.AvaticaDrillSqlAccessor.getObject(AvaticaDrillSqlAccessor.java:179)
              at net.hydromatic.avatica.AvaticaResultSet.getObject(AvaticaResultSet.java:351)
              at org.apache.drill.jdbc.impl.DrillResultSetImpl.getObject(DrillResultSetImpl.java:401)
              at sqlline.Rows$Row.<init>(Rows.java:157)
              at sqlline.IncrementalRows.hasNext(IncrementalRows.java:63)
              at sqlline.TableOutputFormat$ResizingRowsProvider.next(TableOutputFormat.java:87)
              at sqlline.TableOutputFormat.print(TableOutputFormat.java:118)
              at sqlline.SqlLine.print(SqlLine.java:1593)
              at sqlline.Commands.execute(Commands.java:852)
              at sqlline.Commands.sql(Commands.java:751)
              at sqlline.SqlLine.dispatch(SqlLine.java:746)
              at sqlline.SqlLine.begin(SqlLine.java:621)
              at sqlline.SqlLine.start(SqlLine.java:375)
              at sqlline.SqlLine.main(SqlLine.java:268)
      

      As a workaround an empty column can be added to each line (inluding the header).

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                mliebig Matthias Liebig
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: