amansinha100 commented on a change in pull request #1381: DRILL-6475: Unnest: 
Null fieldId Pointer.
URL: https://github.com/apache/drill/pull/1381#discussion_r202781143
 
 

 ##########
 File path: 
exec/java-exec/src/main/java/org/apache/drill/exec/planner/physical/visitor/JoinPrelRenameVisitor.java
 ##########
 @@ -19,36 +19,70 @@
 
 import java.util.ArrayList;
 import java.util.List;
-
+import java.util.Map;
+import java.util.HashMap;
+
+import com.google.common.base.Preconditions;
+import org.apache.calcite.rel.type.RelDataType;
+import org.apache.calcite.rel.type.RelDataTypeField;
+import org.apache.calcite.rex.RexBuilder;
+import org.apache.calcite.rex.RexNode;
 import org.apache.drill.exec.planner.physical.JoinPrel;
 import org.apache.drill.exec.planner.physical.LateralJoinPrel;
 import org.apache.drill.exec.planner.physical.Prel;
 import org.apache.calcite.rel.RelNode;
 
 import com.google.common.collect.Lists;
+import org.apache.drill.exec.planner.physical.UnnestPrel;
 
 public class JoinPrelRenameVisitor extends BasePrelVisitor<Prel, Void, 
RuntimeException>{
 
+  private final Map<String, Prel> sourceOperatorRegistry = new HashMap();
+
   private static JoinPrelRenameVisitor INSTANCE = new JoinPrelRenameVisitor();
 
   public static Prel insertRenameProject(Prel prel){
     return prel.accept(INSTANCE, null);
   }
 
+  private void register(Prel toRegister) {
+    this.sourceOperatorRegistry.put(toRegister.getClass().getSimpleName(), 
toRegister);
 
 Review comment:
   One option is to have a specialized PrelVisitor that does the traversal 
(similar to what we do for a few other things in physical planning) and for the 
right child keeps track of the nearest ancestor Lateral and if it encounters an 
Unnest, it ties up the two together.  In fact the Materalizer already does this 
for the POPs but for your use case this is needed earlier in the planning 
phase. 

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

Reply via email to