You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@drill.apache.org by Nikunj Thakkar <ni...@gmail.com> on 2015/10/05 12:57:30 UTC
Getting Index out of bound while executing statement
Hi,
I'm executing simple statement in current master branch of drill. Getting
following exceptions:
java.sql.SQLException: Unexpected RuntimeException:
java.lang.IndexOutOfBoundsException: Index: 0
at
org.apache.drill.jdbc.impl.DrillCursor.nextRowInternally(DrillCursor.java:261)
at
org.apache.drill.jdbc.impl.DrillCursor.loadInitialSchema(DrillCursor.java:290)
at
org.apache.drill.jdbc.impl.DrillResultSetImpl.execute(DrillResultSetImpl.java:1359)
at
org.apache.drill.jdbc.impl.DrillResultSetImpl.execute(DrillResultSetImpl.java:74)
at
net.hydromatic.avatica.AvaticaConnection.executeQueryInternal(AvaticaConnection.java:404)
at
net.hydromatic.avatica.AvaticaStatement.executeQueryInternal(AvaticaStatement.java:351)
at
net.hydromatic.avatica.AvaticaStatement.executeQuery(AvaticaStatement.java:78)
at
org.apache.drill.jdbc.impl.DrillStatementImpl.executeQuery(DrillStatementImpl.java:97)
at org.apache.drill.jdbc.SampleTest.setup(SampleTest.java:21)
at org.apache.drill.jdbc.SampleTest.testSample(SampleTest.java:29)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:78)
at
com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:212)
at
com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:68)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:140)
Caused by: java.lang.IndexOutOfBoundsException: Index: 0
at java.util.Collections$EmptyList.get(Collections.java:4454)
at
org.apache.drill.exec.proto.UserBitShared$SerializedField.getChild(UserBitShared.java:8390)
at
org.apache.drill.exec.vector.VarCharVector.load(VarCharVector.java:184)
at
org.apache.drill.exec.vector.complex.BaseRepeatedValueVector.load(BaseRepeatedValueVector.java:161)
at
org.apache.drill.exec.record.RecordBatchLoader.load(RecordBatchLoader.java:102)
at
org.apache.drill.jdbc.impl.DrillCursor.nextRowInternally(DrillCursor.java:223)
... 19 more
Code:
Class.forName("org.apache.drill.jdbc.Driver");
Connection connection =
DriverManager.getConnection("jdbc:drill:zk=<my_zookepper_url>:2181/drill/drillbits1");
Statement st = connection.createStatement();
ResultSet rs = st.executeQuery("select * from hdfs.`/test/example.csv`
limit 10");
while (rs.next()) {
System.out.println(rs.getString(1));
}
Any help would be appreciated.
Thanks,
Nikunj
Re: Getting Index out of bound while executing statement
Posted by Nikunj Thakkar <ni...@gmail.com>.
Nope, Same query works fine on sqlline and in v1.1.0 release too. The
issue is V1.1.0 doesn't support prepared statement so I thought if
current build is supporting it, I will use it. But I'm encountering
whole new issues here.
On Monday 05 October 2015 09:17 PM, Abdel Hakim Deneche wrote:
> Hey Nikunj,
>
> Do you get an error if you run the same query in sqlline ?
>
> Thanks
>
> On Mon, Oct 5, 2015 at 7:26 AM, Boris Chmiel <boris.chmiel@yahoo.com.invalid
>> wrote:
>> Hi NikunjNo idea about the meaning this error. I has encountered it many
>> times I found a workaround to get rid of it by changing my request (usually
>> split it into 2 sub-queries)Good luck
>>
>>
>>
>> Le Lundi 5 octobre 2015 12h57, Nikunj Thakkar <
>> nikunjthakkar1992@gmail.com> a écrit :
>>
>>
>> Hi,
>>
>>
>> I'm executing simple statement in current master branch of drill. Getting
>> following exceptions:
>>
>> java.sql.SQLException: Unexpected RuntimeException:
>> java.lang.IndexOutOfBoundsException: Index: 0
>> at
>>
>> org.apache.drill.jdbc.impl.DrillCursor.nextRowInternally(DrillCursor.java:261)
>> at
>>
>> org.apache.drill.jdbc.impl.DrillCursor.loadInitialSchema(DrillCursor.java:290)
>> at
>>
>> org.apache.drill.jdbc.impl.DrillResultSetImpl.execute(DrillResultSetImpl.java:1359)
>> at
>>
>> org.apache.drill.jdbc.impl.DrillResultSetImpl.execute(DrillResultSetImpl.java:74)
>> at
>>
>> net.hydromatic.avatica.AvaticaConnection.executeQueryInternal(AvaticaConnection.java:404)
>> at
>>
>> net.hydromatic.avatica.AvaticaStatement.executeQueryInternal(AvaticaStatement.java:351)
>> at
>>
>> net.hydromatic.avatica.AvaticaStatement.executeQuery(AvaticaStatement.java:78)
>> at
>>
>> org.apache.drill.jdbc.impl.DrillStatementImpl.executeQuery(DrillStatementImpl.java:97)
>> at org.apache.drill.jdbc.SampleTest.setup(SampleTest.java:21)
>> at org.apache.drill.jdbc.SampleTest.testSample(SampleTest.java:29)
>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>> at
>>
>> com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:78)
>> at
>>
>> com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:212)
>> at
>> com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:68)
>> at com.intellij.rt.execution.application.AppMain.main(AppMain.java:140)
>> Caused by: java.lang.IndexOutOfBoundsException: Index: 0
>> at java.util.Collections$EmptyList.get(Collections.java:4454)
>> at
>>
>> org.apache.drill.exec.proto.UserBitShared$SerializedField.getChild(UserBitShared.java:8390)
>> at
>> org.apache.drill.exec.vector.VarCharVector.load(VarCharVector.java:184)
>> at
>>
>> org.apache.drill.exec.vector.complex.BaseRepeatedValueVector.load(BaseRepeatedValueVector.java:161)
>> at
>>
>> org.apache.drill.exec.record.RecordBatchLoader.load(RecordBatchLoader.java:102)
>> at
>>
>> org.apache.drill.jdbc.impl.DrillCursor.nextRowInternally(DrillCursor.java:223)
>> ... 19 more
>>
>> Code:
>>
>> Class.forName("org.apache.drill.jdbc.Driver");
>> Connection connection =
>>
>> DriverManager.getConnection("jdbc:drill:zk=<my_zookepper_url>:2181/drill/drillbits1");
>> Statement st = connection.createStatement();
>> ResultSet rs = st.executeQuery("select * from hdfs.`/test/example.csv`
>> limit 10");
>> while (rs.next()) {
>> System.out.println(rs.getString(1));
>> }
>>
>> Any help would be appreciated.
>>
>> Thanks,
>> Nikunj
>>
>>
>>
>>
>
>
<http://www.quotesdaddy.com/quote/242378/dave-checkett/success-builds-character-failure-reveals-it>
Re: Getting Index out of bound while executing statement
Posted by Abdel Hakim Deneche <ad...@maprtech.com>.
Hey Nikunj,
Do you get an error if you run the same query in sqlline ?
Thanks
On Mon, Oct 5, 2015 at 7:26 AM, Boris Chmiel <boris.chmiel@yahoo.com.invalid
> wrote:
> Hi NikunjNo idea about the meaning this error. I has encountered it many
> times I found a workaround to get rid of it by changing my request (usually
> split it into 2 sub-queries)Good luck
>
>
>
> Le Lundi 5 octobre 2015 12h57, Nikunj Thakkar <
> nikunjthakkar1992@gmail.com> a écrit :
>
>
> Hi,
>
>
> I'm executing simple statement in current master branch of drill. Getting
> following exceptions:
>
> java.sql.SQLException: Unexpected RuntimeException:
> java.lang.IndexOutOfBoundsException: Index: 0
> at
>
> org.apache.drill.jdbc.impl.DrillCursor.nextRowInternally(DrillCursor.java:261)
> at
>
> org.apache.drill.jdbc.impl.DrillCursor.loadInitialSchema(DrillCursor.java:290)
> at
>
> org.apache.drill.jdbc.impl.DrillResultSetImpl.execute(DrillResultSetImpl.java:1359)
> at
>
> org.apache.drill.jdbc.impl.DrillResultSetImpl.execute(DrillResultSetImpl.java:74)
> at
>
> net.hydromatic.avatica.AvaticaConnection.executeQueryInternal(AvaticaConnection.java:404)
> at
>
> net.hydromatic.avatica.AvaticaStatement.executeQueryInternal(AvaticaStatement.java:351)
> at
>
> net.hydromatic.avatica.AvaticaStatement.executeQuery(AvaticaStatement.java:78)
> at
>
> org.apache.drill.jdbc.impl.DrillStatementImpl.executeQuery(DrillStatementImpl.java:97)
> at org.apache.drill.jdbc.SampleTest.setup(SampleTest.java:21)
> at org.apache.drill.jdbc.SampleTest.testSample(SampleTest.java:29)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
>
> com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:78)
> at
>
> com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:212)
> at
> com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:68)
> at com.intellij.rt.execution.application.AppMain.main(AppMain.java:140)
> Caused by: java.lang.IndexOutOfBoundsException: Index: 0
> at java.util.Collections$EmptyList.get(Collections.java:4454)
> at
>
> org.apache.drill.exec.proto.UserBitShared$SerializedField.getChild(UserBitShared.java:8390)
> at
> org.apache.drill.exec.vector.VarCharVector.load(VarCharVector.java:184)
> at
>
> org.apache.drill.exec.vector.complex.BaseRepeatedValueVector.load(BaseRepeatedValueVector.java:161)
> at
>
> org.apache.drill.exec.record.RecordBatchLoader.load(RecordBatchLoader.java:102)
> at
>
> org.apache.drill.jdbc.impl.DrillCursor.nextRowInternally(DrillCursor.java:223)
> ... 19 more
>
> Code:
>
> Class.forName("org.apache.drill.jdbc.Driver");
> Connection connection =
>
> DriverManager.getConnection("jdbc:drill:zk=<my_zookepper_url>:2181/drill/drillbits1");
> Statement st = connection.createStatement();
> ResultSet rs = st.executeQuery("select * from hdfs.`/test/example.csv`
> limit 10");
> while (rs.next()) {
> System.out.println(rs.getString(1));
> }
>
> Any help would be appreciated.
>
> Thanks,
> Nikunj
>
>
>
>
--
Abdelhakim Deneche
Software Engineer
<http://www.mapr.com/>
Now Available - Free Hadoop On-Demand Training
<http://www.mapr.com/training?utm_source=Email&utm_medium=Signature&utm_campaign=Free%20available>
Re: Getting Index out of bound while executing statement
Posted by Boris Chmiel <bo...@yahoo.com.INVALID>.
Hi NikunjNo idea about the meaning this error. I has encountered it many times I found a workaround to get rid of it by changing my request (usually split it into 2 sub-queries)Good luck
Le Lundi 5 octobre 2015 12h57, Nikunj Thakkar <ni...@gmail.com> a écrit :
Hi,
I'm executing simple statement in current master branch of drill. Getting
following exceptions:
java.sql.SQLException: Unexpected RuntimeException:
java.lang.IndexOutOfBoundsException: Index: 0
at
org.apache.drill.jdbc.impl.DrillCursor.nextRowInternally(DrillCursor.java:261)
at
org.apache.drill.jdbc.impl.DrillCursor.loadInitialSchema(DrillCursor.java:290)
at
org.apache.drill.jdbc.impl.DrillResultSetImpl.execute(DrillResultSetImpl.java:1359)
at
org.apache.drill.jdbc.impl.DrillResultSetImpl.execute(DrillResultSetImpl.java:74)
at
net.hydromatic.avatica.AvaticaConnection.executeQueryInternal(AvaticaConnection.java:404)
at
net.hydromatic.avatica.AvaticaStatement.executeQueryInternal(AvaticaStatement.java:351)
at
net.hydromatic.avatica.AvaticaStatement.executeQuery(AvaticaStatement.java:78)
at
org.apache.drill.jdbc.impl.DrillStatementImpl.executeQuery(DrillStatementImpl.java:97)
at org.apache.drill.jdbc.SampleTest.setup(SampleTest.java:21)
at org.apache.drill.jdbc.SampleTest.testSample(SampleTest.java:29)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:78)
at
com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:212)
at
com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:68)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:140)
Caused by: java.lang.IndexOutOfBoundsException: Index: 0
at java.util.Collections$EmptyList.get(Collections.java:4454)
at
org.apache.drill.exec.proto.UserBitShared$SerializedField.getChild(UserBitShared.java:8390)
at
org.apache.drill.exec.vector.VarCharVector.load(VarCharVector.java:184)
at
org.apache.drill.exec.vector.complex.BaseRepeatedValueVector.load(BaseRepeatedValueVector.java:161)
at
org.apache.drill.exec.record.RecordBatchLoader.load(RecordBatchLoader.java:102)
at
org.apache.drill.jdbc.impl.DrillCursor.nextRowInternally(DrillCursor.java:223)
... 19 more
Code:
Class.forName("org.apache.drill.jdbc.Driver");
Connection connection =
DriverManager.getConnection("jdbc:drill:zk=<my_zookepper_url>:2181/drill/drillbits1");
Statement st = connection.createStatement();
ResultSet rs = st.executeQuery("select * from hdfs.`/test/example.csv`
limit 10");
while (rs.next()) {
System.out.println(rs.getString(1));
}
Any help would be appreciated.
Thanks,
Nikunj