You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@drill.apache.org by "Aman Sinha (JIRA)" <ji...@apache.org> on 2015/04/04 00:59:52 UTC
[jira] [Resolved] (DRILL-2075) Subquery not projecting the order by
column is causing issues when used along with flatten
[ https://issues.apache.org/jira/browse/DRILL-2075?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Aman Sinha resolved DRILL-2075.
-------------------------------
Resolution: Duplicate
> Subquery not projecting the order by column is causing issues when used along with flatten
> ------------------------------------------------------------------------------------------
>
> Key: DRILL-2075
> URL: https://issues.apache.org/jira/browse/DRILL-2075
> Project: Apache Drill
> Issue Type: Bug
> Components: Query Planning & Optimization
> Reporter: Rahul Challapalli
> Assignee: Aman Sinha
> Fix For: 0.9.0
>
>
> git.commit.id.abbrev=3c6d0ef
> Data Set :
> {code}
> {
> "uid" : 1,
> "uid_str" : "01",
> "type" : "web",
> "events" : [
> { "evnt_id":"e1", "campaign_id":"c1", "event_name":"e1_name", "event_time":1000000, "type" : "cmpgn1"},
> { "evnt_id":"e2", "campaign_id":"c1", "event_name":"e2_name", "event_time":2000000, "type" : "cmpgn4"},
> { "evnt_id":"e3", "campaign_id":"c1", "event_name":"e3_name", "event_time":3000000, "type" : "cmpgn1"},
> { "evnt_id":"e4", "campaign_id":"c1", "event_name":"e4_name", "event_time":4000000, "type" : "cmpgn1"},
> { "evnt_id":"e5", "campaign_id":"c2", "event_name":"e5_name", "event_time":5000000, "type" : "cmpgn3"},
> { "evnt_id":"e6", "campaign_id":"c1", "event_name":"e6_name", "event_time":6000000, "type" : "cmpgn9"},
> { "evnt_id":"e7", "campaign_id":"c1", "event_name":"e7_name", "event_time":7000000, "type" : "cmpgn3"},
> { "evnt_id":"e8", "campaign_id":"c2", "event_name":"e8_name", "event_time":8000000, "type" : "cmpgn2"},
> { "evnt_id":"e9", "campaign_id":"c2", "event_name":"e9_name", "event_time":9000000, "type" : "cmpgn4"}
> ]
> }
> {code}
> Query with flatten :
> {code}
> select s.type from (select d.type type, flatten(d.events) evnts from `temp.json` d where d.type='web' order by d.uid) s where s.type='web';
> Query failed: IndexOutOfBoundsException: index (2) must be less than size (1)
> Error: exception while executing query: Failure while executing query. (state=,code=0)
> {code}
> Query without flatten :
> {code}
> select s.type from (select d.type type from `temp.json` d where d.type='web' order by d.uid) s where s.type='web';
> +------------+
> | type |
> +------------+
> | web |
> +------------+
> {code}
> However even the above query fails when we remove the filter and this could be related to DRILL-1302
> {code}
> 0: jdbc:drill:schema=dfs.drillTestDir> select s.type from (select d.type type from `temp.json` d where d.type='web' order by d.uid) s;
> Query failed: ArrayIndexOutOfBoundsException: -1
> Error: exception while executing query: Failure while executing query. (state=,code=0)
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)