clintropolis commented on a change in pull request #8047: optimize single input 
column multi-value expressions
URL: https://github.com/apache/incubator-druid/pull/8047#discussion_r309544405
 
 

 ##########
 File path: core/src/main/java/org/apache/druid/math/expr/Expr.java
 ##########
 @@ -304,7 +334,37 @@ public BindingDetails withArrayArguments(Set<Expr> 
arrayArguments)
       return new BindingDetails(
           ImmutableSet.copyOf(Sets.union(freeVariables, arrayIdentifiers)),
           scalarVariables,
-          ImmutableSet.copyOf(Sets.union(arrayVariables, arrayIdentifiers))
+          ImmutableSet.copyOf(Sets.union(arrayVariables, arrayIdentifiers)),
+          hasInputArrays || arrayArguments.size() > 0,
 
 Review comment:
   Oh i wasn't paying attention to which function this was, it is possible in 
this specific context and it's unrelated to the other thing. 
   
   Since this is a sort of 'builder' method it is hypothetically possible for 
this method to be called when adding the initial set of array columns on a 
binding details, without explicitly calling `withArrayInputs`. This `||` then 
ensures that if even if you forgot to call `withArrayInputs` the binding 
details being constructed are correct, becase the `hasInputArrays` in this case 
is the value of the existing binding before the array arguments are added.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to