dongjoon-hyun commented on a change in pull request #24495: [SPARK-27604][SQL]
Add filter reduction
URL: https://github.com/apache/spark/pull/24495#discussion_r282195808
##########
File path:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/expressions.scala
##########
@@ -55,99 +55,114 @@ object ConstantFolding extends Rule[LogicalPlan] {
}
/**
- * Substitutes [[Attribute Attributes]] which can be statically evaluated with
their corresponding
+ * Substitutes [[Expression Expressions]] which can be statically evaluated
with their corresponding
* value in conjunctive [[Expression Expressions]]
* eg.
* {{{
- * SELECT * FROM table WHERE i = 5 AND j = i + 3
- * ==> SELECT * FROM table WHERE i = 5 AND j = 8
+ * SELECT * FROM table WHERE i = 5 AND j = i + 3 => ... WHERE i
= 5 AND j = 8
+ * SELECT * FROM table WHERE abs(i) = 5 AND j <= abs(i) + 3 => ... WHERE
abs(i) = 5 AND j <= 8
* }}}
*
* Approach used:
- * - Populate a mapping of attribute => constant value by looking at all the
equals predicates
- * - Using this mapping, replace occurrence of the attributes with the
corresponding constant values
- * in the AND node.
+ * - Populate a mapping of expression => constant value by looking at all the
deterministic equals
+ * predicates
+ * - Using this mapping, replace occurrence of the expressions with the
corresponding constant
+ * values in the AND node.
*/
object ConstantPropagation extends Rule[LogicalPlan] with PredicateHelper {
Review comment:
Since new PR is created, we had better remove this change from this PR.
----------------------------------------------------------------
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]