You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Chiradip Mandal (JIRA)" <ji...@apache.org> on 2019/01/04 01:05:00 UTC

[jira] [Created] (CALCITE-2769) CSV Adapter does not handle - Empty and malformed csv lines, space before or after comma

Chiradip Mandal created CALCITE-2769:
----------------------------------------

             Summary: CSV Adapter does not handle - Empty and malformed csv lines, space before or after comma
                 Key: CALCITE-2769
                 URL: https://issues.apache.org/jira/browse/CALCITE-2769
             Project: Calcite
          Issue Type: Bug
          Components: csv-adapter
    Affects Versions: 1.18.0
            Reporter: Chiradip Mandal
            Assignee: Julian Hyde
             Fix For: next


File: org.apache.calcite.adapter.csv.CsvEnumerator.java in example folder did not handle CSV with space between delimiter i.e."," and also did not handle empty lines or malformed lines in the middle of the file or to the end. The sqlline crashes is there is an empty line with java.lang.ArrayIndexOutOfBoundsException. 

 

java.lang.ArrayIndexOutOfBoundsException: 1

at org.apache.calcite.adapter.csv.CsvEnumerator$ArrayRowConverter.convertNormalRow(CsvEnumerator.java:347)

at org.apache.calcite.adapter.csv.CsvEnumerator$ArrayRowConverter.convertRow(CsvEnumerator.java:339)

at org.apache.calcite.adapter.csv.CsvEnumerator$ArrayRowConverter.convertRow(CsvEnumerator.java:317)

at org.apache.calcite.adapter.csv.CsvEnumerator.moveNext(CsvEnumerator.java:204)

at org.apache.calcite.linq4j.EnumerableDefaults$10$1.moveNext(EnumerableDefaults.java:1878)

at org.apache.calcite.linq4j.EnumerableDefaults$10$1.moveNext(EnumerableDefaults.java:1878)

at org.apache.calcite.linq4j.TransformedEnumerator.moveNext(TransformedEnumerator.java:35)

at org.apache.calcite.linq4j.Linq4j$EnumeratorIterator.next(Linq4j.java:684)

at org.apache.calcite.avatica.util.IteratorCursor.next(IteratorCursor.java:46)

at org.apache.calcite.avatica.AvaticaResultSet.next(AvaticaResultSet.java:217)

at sqlline.IncrementalRows.hasNext(IncrementalRows.java:73)

at sqlline.TableOutputFormat.print(TableOutputFormat.java:38)

at sqlline.SqlLine.print(SqlLine.java:1719)

at sqlline.Commands.execute(Commands.java:949)

at sqlline.Commands.sql(Commands.java:882)

at sqlline.SqlLine.dispatch(SqlLine.java:725)

at sqlline.SqlLine.begin(SqlLine.java:540)

at sqlline.SqlLine.start(SqlLine.java:264)

at sqlline.SqlLine.main(SqlLine.java:195)



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)