dongjoon-hyun commented on code in PR #60631:
URL: https://github.com/apache/spark/pull/60631#discussion_r4607754613


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/Optimizer.scala:
##########
@@ -2631,10 +2631,14 @@ object CombineFilters extends Rule[LogicalPlan] with 
PredicateHelper {
     // Combining a condition written after a non-deterministic or throwable 
one evaluates it ahead
     // of that one, so it must also be unable to fail. `throwable` does not 
report e.g. a division
     // by zero in ANSI mode, which the condition before it may have kept from 
being evaluated.
+    // Nor may it read a column that can fail (see `failableOutput`).
     case Filter(fc, nf @ Filter(nc, grandChild)) if nc.deterministic =>
       val (leading, following) =
         splitConjunctivePredicates(fc).span(p => p.deterministic && 
!p.throwable)
-      val (cannotFail, rest) = 
following.partition(ExprUtils.canEvaluateUnconditionally)
+      lazy val failable = failableOutput(grandChild)

Review Comment:
   You are right, thank you for the correction. v4.3.0's `CombineFilters` 
combines `d = ...` and prunes by it, so this PR is what drops it. I updated the 
user-facing section to say that such a query no longer prunes partitions by 
`dt`, as SPARK-60980 did for `upper(p) = '1'`.



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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to