Github user jinfengni commented on a diff in the pull request:

    https://github.com/apache/drill/pull/189#discussion_r42444043
  
    --- Diff: 
exec/java-exec/src/main/java/org/apache/drill/exec/expr/EvaluationVisitor.java 
---
    @@ -106,19 +163,32 @@ public HoldingContainer 
visitFunctionCall(FunctionCall call, ClassGenerator<?> g
         @Override
         public HoldingContainer visitBooleanOperator(BooleanOperator op,
             ClassGenerator<?> generator) throws RuntimeException {
    +      HoldingContainer hc = getPrevious(op);
    +      if (hc != null) {
    +        return hc;
    +      }
    +      newScope();
    --- End diff --
    
    Is it possible to move the call of newScope() and leaveScope() to 
ClassGenerator.nestEvalBlock(), unnestEvalBlock()? Those two methods would 
essentially create / remove a new nested scope in the code, and is actually 
called for BooleanOperator (and/or) and IfExpression. 
    
    Otherwise, we have to remember to call newScope() / leaveScope() everywhere 
the codes creates/delete a new scope, which seems to be error-prone.
     


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to