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

Hanumath Rao Maduri commented on DRILL-6476:
--------------------------------------------

Explain plan for the following lateral unnest query.

{code}

explain plan for select * from (select customer.orders as c_orders from  
dfs.`/home/mapr/LATERAL/drill/exec/java-exec/src/test/resources/lateraljoin/nested-customer.parquet`
 customer ) t1,  lateral ( select t.ord.o_lineitems as items from 
unnest(t1.c_orders) t(ord) ) t2, lateral (select count(*)  from 
unnest(t2.items) t3(item)) d1;

 

| 00-00 Screen : rowType = RecordType(ANY c_orders, ANY items, BIGINT EXPR$0): 
rowcount = 1.0, cumulative cost = \{15.1 rows, 74.1 cpu, 0.0 io, 0.0 network, 
0.0 memory}, id = 6223
00-01 Project(c_orders=[$0], items=[$1], EXPR$0=[$2]) : rowType = 
RecordType(ANY c_orders, ANY items, BIGINT EXPR$0): rowcount = 1.0, cumulative 
cost = \{15.0 rows, 74.0 cpu, 0.0 io, 0.0 network, 0.0 memory}, id = 6222
00-02 Correlate(correlation=[$cor1], joinType=[inner], requiredColumns=[\{1}]) 
: rowType = RecordType(ANY orders, ANY items, BIGINT EXPR$0): rowcount = 1.0, 
cumulative cost = \{14.0 rows, 71.0 cpu, 0.0 io, 0.0 network, 0.0 memory}, id = 
6221
00-04 Correlate(correlation=[$cor0], joinType=[inner], requiredColumns=[\{0}]) 
: rowType = RecordType(ANY orders, ANY items): rowcount = 1.0, cumulative cost 
= \{10.0 rows, 38.0 cpu, 0.0 io, 0.0 network, 0.0 memory}, id = 6218
00-07 Scan(groupscan=[ParquetGroupScan [entries=[ReadEntryWithPath 
[path=file:/home/mapr/LATERAL/drill/exec/java-exec/src/test/resources/lateraljoin/nested-customer.parquet]],
 
selectionRoot=file:/home/mapr/LATERAL/drill/exec/java-exec/src/test/resources/lateraljoin/nested-customer.parquet,
 numFiles=1, numRowGroups=1, usedMetadataFile=false, columns=[`orders`]]]) : 
rowType = RecordType(ANY orders): rowcount = 4.0, cumulative cost = \{4.0 rows, 
4.0 cpu, 0.0 io, 0.0 network, 0.0 memory}, id = 6216
00-06 Project(items=[ITEM($0, 'o_lineitems')]) : rowType = RecordType(ANY 
items): rowcount = 1.0, cumulative cost = \{2.0 rows, 2.0 cpu, 0.0 io, 0.0 
network, 0.0 memory}, id = 6217
00-09 Unnest [SrcOp: (00-04)] : rowType = RecordType(ANY c_orders): rowcount = 
1.0, cumulative cost = \{1.0 rows, 1.0 cpu, 0.0 io, 0.0 network, 0.0 memory}, 
id = 6055
00-03 StreamAgg(group=[{}], EXPR$0=[COUNT()]) : rowType = RecordType(BIGINT 
EXPR$0): rowcount = 1.0, cumulative cost = \{3.0 rows, 17.0 cpu, 0.0 io, 0.0 
network, 0.0 memory}, id = 6220
00-05 Project($f0=[0]) : rowType = RecordType(INTEGER $f0): rowcount = 1.0, 
cumulative cost = \{2.0 rows, 5.0 cpu, 0.0 io, 0.0 network, 0.0 memory}, id = 
6219
00-08 Unnest [SrcOp: (00-02)]: rowType = RecordType(ANY items): rowcount = 1.0, 
cumulative cost = \{1.0 rows, 1.0 cpu, 0.0 io, 0.0 network, 0.0 memory}, id = 
6058
 {code}

> Generate explain plan which shows relation between Lateral and the 
> corresponding Unnest.
> ----------------------------------------------------------------------------------------
>
>                 Key: DRILL-6476
>                 URL: https://issues.apache.org/jira/browse/DRILL-6476
>             Project: Apache Drill
>          Issue Type: Bug
>          Components: Query Planning & Optimization
>    Affects Versions: 1.14.0
>            Reporter: Hanumath Rao Maduri
>            Assignee: Hanumath Rao Maduri
>            Priority: Major
>
> Currently, explain plan doesn't show that which lateral and  unnest node's 
> are related. This information is good to have so that the visual plan can use 
> it and show the relation visually.
>  
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to