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

ASF GitHub Bot commented on DRILL-6476:
---------------------------------------

kkhatua commented on a change in pull request #1308: DRILL-6476: Generate 
explain plan which shows relation between Latera…
URL: https://github.com/apache/drill/pull/1308#discussion_r193960892
 
 

 ##########
 File path: 
exec/java-exec/src/main/java/org/apache/drill/exec/planner/physical/explain/NumberingRelWriter.java
 ##########
 @@ -125,14 +131,56 @@ protected void explain_(
     }
     pw.println(s);
     spacer.add(2);
-    explainInputs(inputs);
+    explainInputs(rel);
     spacer.subtract(2);
   }
 
-  private void explainInputs(List<RelNode> inputs) {
-    for (RelNode input : inputs) {
-      input.explain(this);
+  private String getDependentSrcOp(RelNode rel) {
+    if (rel instanceof UnnestPrel) {
+      return this.getDependentSrcOp((UnnestPrel) rel);
     }
+    return "";
+  }
+
+  private String getDependentSrcOp(UnnestPrel unnest) {
+    Prel parent = this.getRegisteredPrel(unnest.getParentClass());
+    if (parent != null && parent instanceof CorrelatePrel) {
+      OpId id = ids.get(parent);
+      return String.format(" [SrcOp: (%02d-%02d)] ", id.fragmentId, id.opId);
 
 Review comment:
   Without the change, the visual plan rendering remains unchanged:
   
![image](https://user-images.githubusercontent.com/4335237/41141843-596c3fe4-6aa8-11e8-9e81-45ee5d9da144.png)
   
   
   With the change, the visual plan is rndered:
   
![image](https://user-images.githubusercontent.com/4335237/41141833-4c848a84-6aa8-11e8-894b-b7d6be9a2274.png)
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> 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 &amp; 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