You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@drill.apache.org by "Anton Gozhiy (JIRA)" <ji...@apache.org> on 2019/06/13 10:31:00 UTC
[jira] [Closed] (DRILL-4814) extractHeader attribute not working
with the table function
[ https://issues.apache.org/jira/browse/DRILL-4814?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Anton Gozhiy closed DRILL-4814.
-------------------------------
Verified with Drill version 1.17.0-SNAPSHOT (commit de0aec7951254949ae9206d6f63b5077684dac8a).
The issue is not reproducible with V3 text reader.
> extractHeader attribute not working with the table function
> -----------------------------------------------------------
>
> Key: DRILL-4814
> URL: https://issues.apache.org/jira/browse/DRILL-4814
> Project: Apache Drill
> Issue Type: Bug
> Components: Storage - Text & CSV
> Affects Versions: 1.8.0
> Reporter: Krystal
> Assignee: Paul Rogers
> Priority: Major
> Fix For: 1.16.0
>
>
> I have the following table with line delimiter as \r\n:
> Id,col1,col2
> 1,aaa,bbb
> 2,ccc,ddd
> 3,eee
> 4,fff,ggg
> The following queries work fine:
> select * from table(`drill-3149/header.csv`(type=>'text',lineDelimiter=>'\r\n',fieldDelimiter=>','));
> +-----------------------+
> | columns |
> +-----------------------+
> | ["Id","col1","col2"] |
> | ["1","aaa","bbb"] |
> | ["2","ccc","ddd"] |
> | ["3","eee"] |
> | ["4","fff","ggg"] |
> +-----------------------+
> select * from table(`drill-3149/header.csv`(type=>'text',lineDelimiter=>'\r\n',fieldDelimiter=>',',skipFirstLine=>true));
> +--------------------+
> | columns |
> +--------------------+
> | ["1","aaa","bbb"] |
> | ["2","ccc","ddd"] |
> | ["3","eee"] |
> | ["4","fff","ggg"] |
> +--------------------+
> The following query fail with extractHeader attribute:
> select * from table(`drill-3149/header.csv`(type=>'text',lineDelimiter=>'\r\n',fieldDelimiter=>',',extractHeader=>true));
> {code}
> java.lang.IndexOutOfBoundsException: index: 254, length: 3 (expected: range(0, 256))
> at io.netty.buffer.AbstractByteBuf.checkIndex(AbstractByteBuf.java:1134)
> at io.netty.buffer.PooledUnsafeDirectByteBuf.getBytes(PooledUnsafeDirectByteBuf.java:136)
> at io.netty.buffer.WrappedByteBuf.getBytes(WrappedByteBuf.java:289)
> at io.netty.buffer.UnsafeDirectLittleEndian.getBytes(UnsafeDirectLittleEndian.java:30)
> at io.netty.buffer.DrillBuf.getBytes(DrillBuf.java:629)
> at org.apache.drill.exec.vector.VarCharVector$Accessor.get(VarCharVector.java:441)
> 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:420)
> 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}
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)