[ 
https://issues.apache.org/jira/browse/DRILL-3968?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14973865#comment-14973865
 ] 

Dmitriy edited comment on DRILL-3968 at 10/26/15 9:27 AM:
----------------------------------------------------------

Here is some examples of queries I try

1) select min(data.ownerAge), max(data.ownerAge) from fs.jsn.`/testData01.json` 
data
2) select distinct data.firstName from fs.jsn.`/testData01.json` data where 
data.ownerAge >= 30.0 order by data.firstName asc limit 10
3) select data.firstName, max(data.ownerAge) from fs.jsn.`/testData01.json` 
data where data.averageIncome >= 100.0 group by data.firstName order by 
max(data.ownerAge) desc limit 3

When I have running drill 1.0.0 and use in my code driver version 1.2.0 I have 
error, I printed above. If I run queries from drill web console they works ok 
(still drill version 1.0.0). If I run drill version 1.2.0 and use in my code 
driver version 1.2.0 they also works ok. When I have drill 1.0.0 or 1.1.0 and 
driver version 1.0.0 everything works.

Also I tried very simple query 
select * from data.jsn.`testData01.json` limit 5  
and have same issue.


was (Author: dimaga):
Here is some examples of queries I try

1) select min(data.ownerAge), max(data.ownerAge) from fs.jsn.`/testData01.json` 
data
2) select distinct data.firstName from fs.jsn.`/testData01.json` data where 
data.ownerAge >= 30.0 order by data.firstName asc limit 10
3) select data.firstName, max(data.ownerAge) from fs.jsn.`/testData01.json` 
data where data.averageIncome >= 100.0 group by data.firstName order by 
max(data.ownerAge) desc limit 3

When I have running drill 1.0.0 and use in my code driver version 1.2.0 I have 
error, I printed above. If I run queries from drill web console they works ok 
(still drill version 1.0.0). If I run drill version 1.2.0 and use in my code 
driver version 1.2.0 they also works ok. When I have drill 1.0.0 or 1.1.0 and 
driver version 1.0.0 everything works.

Also I tried very simple query 
select * from data.jsn.`testData01.json` limit 5  and have same issue.

> JDBC driver seems to be not compatible with previous versions of apache drill.
> ------------------------------------------------------------------------------
>
>                 Key: DRILL-3968
>                 URL: https://issues.apache.org/jira/browse/DRILL-3968
>             Project: Apache Drill
>          Issue Type: Bug
>    Affects Versions: 1.2.0
>            Reporter: Dmitriy
>
> When try to execute query using jdbc-driver-all version 1.2.0 to environment 
> with drill 1.0.0 or 1.1.0  I have the following exception
> Exception in thread "main" 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 
> oadd.net.hydromatic.avatica.AvaticaConnection.executeQueryInternal(AvaticaConnection.java:404)
>       at 
> oadd.net.hydromatic.avatica.AvaticaStatement.executeQueryInternal(AvaticaStatement.java:351)
>       at 
> oadd.net.hydromatic.avatica.AvaticaStatement.executeQuery(AvaticaStatement.java:78)
>       at 
> org.apache.drill.jdbc.impl.DrillStatementImpl.executeQuery(DrillStatementImpl.java:97)
>       at TestNewDriver.test(TestNewDriver.java:24)
>       at TestNewDriver.main(TestNewDriver.java:17)
>       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>       at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
>       at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>       at java.lang.reflect.Method.invoke(Method.java:497)
>       at com.intellij.rt.execution.application.AppMain.main(AppMain.java:134)
> Caused by: java.lang.IndexOutOfBoundsException: Index: 0
>       at java.util.Collections$EmptyList.get(Collections.java:4454)
>       at 
> oadd.org.apache.drill.exec.proto.UserBitShared$SerializedField.getChild(UserBitShared.java:8390)
>       at 
> oadd.org.apache.drill.exec.vector.NullableVarCharVector.load(NullableVarCharVector.java:258)
>       at 
> oadd.org.apache.drill.exec.record.RecordBatchLoader.load(RecordBatchLoader.java:102)
>       at 
> org.apache.drill.jdbc.impl.DrillCursor.nextRowInternally(DrillCursor.java:223)
>       ... 14 more



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to