[ 
https://issues.apache.org/jira/browse/DRILL-3762?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Khurram Faraaz updated DRILL-3762:
----------------------------------
    Fix Version/s:     (was: 1.3.0)
                   Future

> NPE : Query nested JSON data
> ----------------------------
>
>                 Key: DRILL-3762
>                 URL: https://issues.apache.org/jira/browse/DRILL-3762
>             Project: Apache Drill
>          Issue Type: Bug
>          Components: Client - JDBC
>    Affects Versions: 1.2.0
>         Environment: 4 node cluster CentOS
>            Reporter: Khurram Faraaz
>             Fix For: Future
>
>
> Drill master commit ID : 0686bc23
> I am seeing an NPE when I try to query nested data. Interestingly there are 
> no Exceptions written to either drillbit.log or drillbit.out, I had to set 
> verbose mode to ON, on sqlline to see the stack trace.
> {code}
> 0: jdbc:drill:schema=dfs.tmp> select * from `repro_data.json`;
> +---------------------------------------------------------------------+
> |                                meta                                 |
> +---------------------------------------------------------------------+
> | {"view":{"columns":[{"cachedCounts":{"smallest":"hello world"}}]}}  |
> +---------------------------------------------------------------------+
> 1 row selected (2.401 seconds)
> 0: jdbc:drill:schema=dfs.tmp> select t.meta.view.columns from 
> `repro_data.json` t;
> +------------------------------------------------+
> |                     EXPR$0                     |
> +------------------------------------------------+
> | [{"cachedCounts":{"smallest":"hello world"}}]  |
> +------------------------------------------------+
> 1 row selected (0.347 seconds)
> 0: jdbc:drill:schema=dfs.tmp> select t.meta.view.columns[1] from 
> `repro_data.json` t;
> Error: Unexpected RuntimeException: java.lang.NullPointerException 
> (state=,code=0)
> 0: jdbc:drill:schema=dfs.tmp> !verbose true
> verbose: on
> 0: jdbc:drill:schema=dfs.tmp> select t.meta.view.columns[1] from 
> `repro_data.json` t;
> Error: Unexpected RuntimeException: java.lang.NullPointerException 
> (state=,code=0)
> java.sql.SQLException: Unexpected RuntimeException: 
> java.lang.NullPointerException
>       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.executeInternal(AvaticaStatement.java:338)
>       at 
> net.hydromatic.avatica.AvaticaStatement.execute(AvaticaStatement.java:69)
>       at 
> org.apache.drill.jdbc.impl.DrillStatementImpl.execute(DrillStatementImpl.java:86)
>       at sqlline.Commands.execute(Commands.java:841)
>       at sqlline.Commands.sql(Commands.java:751)
>       at sqlline.SqlLine.dispatch(SqlLine.java:738)
>       at sqlline.SqlLine.begin(SqlLine.java:612)
>       at sqlline.SqlLine.start(SqlLine.java:366)
>       at sqlline.SqlLine.main(SqlLine.java:259)
> Caused by: java.lang.NullPointerException
>       at 
> org.apache.drill.exec.record.RecordBatchLoader.load(RecordBatchLoader.java:99)
>       at 
> org.apache.drill.jdbc.impl.DrillCursor.nextRowInternally(DrillCursor.java:223)
>       ... 14 more
> {code}
> Data used in the test, repo_data.json
> {code}
> {
> "meta":{
>     "view":{
>         "columns":[{"cachedCounts":{ "smallest":"hello world"}}]
>     }
> }
> }
> {code}



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

Reply via email to