[
https://issues.apache.org/jira/browse/DRILL-1101?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14527680#comment-14527680
]
Khurram Faraaz commented on DRILL-1101:
---------------------------------------
Verified on 10833d2cae9f5312cf0e31f8c9f3f8a9dcdc0c45 | Commit 0.9.0 release
version. | 03.05.2015 @ 14:56:56 EDT
test will be added into union_all tests.
{code}
0: jdbc:drill:> select 'abcdef' from `testWindow.csv` union all select 'xyz'
from `employee.csv`;
+------------+
| EXPR$0 |
+------------+
| abcdef |
| abcdef |
| abcdef |
| abcdef |
| abcdef |
| abcdef |
| abcdef |
| abcdef |
| abcdef |
| abcdef |
| abcdef |
| xyz |
+------------+
12 rows selected (0.185 seconds)
{code}
{code}
0: jdbc:drill:> explain plan for select 'abcdef' from `testWindow.csv` union
all select 'xyz' from `employee.csv`;
+------------+------------+
| text | json |
+------------+------------+
| 00-00 Screen
00-01 UnionAll(all=[true])
00-03 Project(EXPR$0=['abcdef'])
00-05 Scan(groupscan=[EasyGroupScan
[selectionRoot=/tmp/testWindow.csv, numFiles=1, columns=[`*`],
files=[maprfs:/tmp/testWindow.csv]]])
00-02 Project(EXPR$0=['xyz'])
00-04 Scan(groupscan=[EasyGroupScan [selectionRoot=/tmp/employee.csv,
numFiles=1, columns=[`*`], files=[maprfs:/tmp/employee.csv]]])
{code}
> Cannot plan exception- Union all
> --------------------------------
>
> Key: DRILL-1101
> URL: https://issues.apache.org/jira/browse/DRILL-1101
> Project: Apache Drill
> Issue Type: Bug
> Components: Query Planning & Optimization
> Reporter: Ramana Inukonda Nagaraj
> Assignee: Ramana Inukonda Nagaraj
> Priority: Blocker
> Fix For: 0.4.0
>
> Attachments:
> 0001-DRILL-1101-For-Union-All-allow-strings-of-different-.patch
>
>
> Following query results in a CannotPlanException
> select emails.technology_type , emails.organization,
> emails.metric_no, emails.metric_name, emails.metric_value
> from(
> select 'emails' as technology_type ,
> b1.organization as organization,
> 1 as metric_no, 'email_count' as metric_name, 2*count(distinct
> message_id) as metric_value
> from emails a1
> left outer join employee_table b1
> on (a1.sender_address = b1.emailid)
> where a1.event_id = 'RECEIVE'
> group by b1.organization
> union all
> select 'emails' as technology_type,
> b2.organization as organization,
> 2 as metric_no, 'email_active_employee_count' as metric_name,
> count(*) as metric_value
> from employee_table b2
> where b2.status = 'A'
> group by b2.organization
> ) emails;
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)