Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id EB855200B77 for ; Sat, 30 Jul 2016 00:04:22 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id EA5F9160AA6; Fri, 29 Jul 2016 22:04:22 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 46718160AAB for ; Sat, 30 Jul 2016 00:04:22 +0200 (CEST) Received: (qmail 48577 invoked by uid 500); 29 Jul 2016 22:04:21 -0000 Mailing-List: contact issues-help@drill.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@drill.apache.org Delivered-To: mailing list issues@drill.apache.org Received: (qmail 48431 invoked by uid 99); 29 Jul 2016 22:04:21 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 29 Jul 2016 22:04:21 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 0AA562C0D63 for ; Fri, 29 Jul 2016 22:04:21 +0000 (UTC) Date: Fri, 29 Jul 2016 22:04:21 +0000 (UTC) From: "Krystal (JIRA)" To: issues@drill.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Created] (DRILL-4814) extractHeader attribute not working with the table function MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Fri, 29 Jul 2016 22:04:23 -0000 Krystal created DRILL-4814: ------------------------------ Summary: 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 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.(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 (v6.3.4#6332)