Github user cloud-fan commented on a diff in the pull request:

    https://github.com/apache/spark/pull/13087#discussion_r63992511
  
    --- 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 --
    
    I'm not sure if I understand this correctly, do you mean `ScalaUDF` can be 
nondeterministic and we should always treat it as nondeterministic expression? 
If so, I think a better idea is just override `deterministic` in `ScalaUDF` and 
always return false.


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