You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2019/05/06 12:33:52 UTC

[GitHub] [spark] peter-toth commented on a change in pull request #24495: [SPARK-27604][SQL] Enhance constant propagation to constraint propagation

peter-toth commented on a change in pull request #24495: [SPARK-27604][SQL] Enhance constant propagation to constraint propagation
URL: https://github.com/apache/spark/pull/24495#discussion_r281165606
 
 

 ##########
 File path: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/expressions.scala
 ##########
 @@ -55,100 +55,24 @@ object ConstantFolding extends Rule[LogicalPlan] {
 }
 
 /**
- * Substitutes [[Attribute Attributes]] which can be statically evaluated with their corresponding
- * value in conjunctive [[Expression Expressions]]
+ * Substitutes expressions which can be statically narrowed by constrains.
  * 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     => SELECT * FROM table WHERE i = 5 AND j = 8
+ *   SELECT * FROM table WHERE i <= 5 AND i = 5        => SELECT * FROM table WHERE i = 5
 
 Review comment:
   I separated the 2 rules. I added some improvement to the `ConstantPropagation' and created a new 'FilterReduction`.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org