You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@drill.apache.org by "Matthias Liebig (JIRA)" <ji...@apache.org> on 2015/11/27 18:31:11 UTC

[jira] [Created] (DRILL-4140) csv extractHeader: fails on multiple empty columns

Matthias Liebig created DRILL-4140:
--------------------------------------

             Summary: csv extractHeader: fails on multiple empty columns
                 Key: DRILL-4140
                 URL: https://issues.apache.org/jira/browse/DRILL-4140
             Project: Apache Drill
          Issue Type: Bug
          Components: Storage - Text & CSV
    Affects Versions: 1.3.0
         Environment: Linux (RHEL 7.1)
            Reporter: Matthias Liebig
            Priority: Minor


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

{code:title=csv_with_header.csvh|borderStyle=solid}
name,num1,num2,num3
hello,1,2,3
hello,,,
hello,1,2,3
hello,1,2,3
{code}

{code:java}
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)
{code}

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



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)