dongjoon-hyun 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_r279815471
 
 

 ##########
 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 don't think this aims the equal goal. Could you make a separate rule 
instead?

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

Reply via email to