[ https://issues.apache.org/jira/browse/DRILL-4814?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16786930#comment-16786930 ]
Arina Ielchiieva commented on DRILL-4814: ----------------------------------------- Can be reproduced when storage format is set to extractHeader, so this not table function specific. > 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: Functions - Drill > Affects Versions: 1.8.0 > Reporter: Krystal > Assignee: Paul Rogers > Priority: Major > > 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)