Github user dongjoon-hyun commented on a diff in the pull request:

    https://github.com/apache/spark/pull/13087#discussion_r63997574
  
    --- Diff: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/Optimizer.scala
 ---
    @@ -1025,7 +1025,8 @@ object PushDownPredicate extends Rule[LogicalPlan] 
with PredicateHelper {
         // state and all the input rows processed before. In another word, the 
order of input rows
         // matters for non-deterministic expressions, while pushing down 
predicates changes the order.
         case filter @ Filter(condition, project @ Project(fields, grandChild))
    -      if fields.forall(_.deterministic) =>
    +        if fields.forall(_.deterministic) &&
    +          fields.forall(_.find(_.isInstanceOf[ScalaUDF]).isEmpty) =>
    --- End diff --
    
    Thank you, @cloud-fan , again!
    Yep. Right. Exactly, I really wanted to do that. So, I made my first 
initial commit for this PR.
    
    But, you can see the result in the above.
    * the first initial commit: 
https://github.com/apache/spark/pull/13087/commits/85fa0406280802259cd141d8ad9fdeb9b9173405
    
    * Jenkins result: 
https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/58531/consoleFull
    
    * My decision:
    
     > There are several cases which assumes UDF is deterministic. It would be 
a big change to user. I'll revert the change on ScalaUDF, and update this PR to 
change optimizer not to duplicate the UDF expression.
    
    I still think that is a correct solution. I mean I totally agree with you. 
But, as you see, it needs to change other testsuites, so I thought I need 
commiters' decision to do that.


---
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.
---

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

Reply via email to