beliefer commented on code in PR #52554:
URL: https://github.com/apache/spark/pull/52554#discussion_r2415885140


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/Optimizer.scala:
##########
@@ -2776,6 +2777,71 @@ object RemoveLiteralFromGroupExpressions extends 
Rule[LogicalPlan] {
   }
 }
 
+/**
+ * To optimize performance, filter conditions should be pushed down in 
[[CountIf]] queries
+ * to reduce the volume of data being processed.
+ *
+ * Input Query :
+ * {{{
+ *     SELECT count_if(c1 > 1) FROM ut1
+ *  }}}
+ *
+ * Rewritten Query:
+ * {{{
+ *     SELECT count_if(c1 > 1) FROM ut1 where c1 > 1

Review Comment:
   Why not rewrite to `SELECT count(_) FROM ut1 where c1 > 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