You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@drill.apache.org by "Rahul Challapalli (JIRA)" <ji...@apache.org> on 2015/01/28 19:24:35 UTC

[jira] [Commented] (DRILL-2094) Drill has problems with reading json fields when used in a subquery

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

Rahul Challapalli commented on DRILL-2094:
------------------------------------------

The below queries work as expected 

{code}
0: jdbc:drill:schema=dfs.drillTestDir> select s.id from (select id, list[0] from `temp1.json`) s;
+------------+
|     id     |
+------------+
| 1          |
+------------+
1 row selected (0.083 seconds)
{code}

{code}
0: jdbc:drill:schema=dfs.drillTestDir> select s.id from (select id from `temp1.json` where list[0] =1) s;
+------------+
|     id     |
+------------+
| 1          |
+------------+
1 row selected (0.187 seconds)
{code}

So this could be related to "order by"

> Drill has problems with reading json fields when used in a subquery
> -------------------------------------------------------------------
>
>                 Key: DRILL-2094
>                 URL: https://issues.apache.org/jira/browse/DRILL-2094
>             Project: Apache Drill
>          Issue Type: Bug
>          Components: Query Planning & Optimization
>            Reporter: Rahul Challapalli
>            Assignee: Jinfeng Ni
>
> git.commit.id.abbrev=3e33880
> Data Set :
> {code}
> {
>   "id" : 1,
>   "list" : [1,2]
> }
> {code} 
> The below query works
> {code}
> 0: jdbc:drill:schema=dfs.drillTestDir> select id from `temp1.json` order by list[0];
> +------------+
> |     id     |
> +------------+
> | 1          |
> +------------+
> 1 row selected (0.146 seconds)
> {code}
> However when I used the same exact query as part of a sub-query, I get an error from drill
> {code}
> 0: jdbc:drill:schema=dfs.drillTestDir> select s.id from (select id from `temp1.json` order by list[0]) s;
> Query failed: SqlValidatorException: Table 'list' not found
> Error: exception while executing query: Failure while executing query. (state=,code=0)
> {code}
> Explain plan also does not work and it returns the same problem



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