peter-toth opened a new pull request #24553: [SPARK-27604][SQL] Enhance 
constant propagation
URL: https://github.com/apache/spark/pull/24553
 
 
   ## What changes were proposed in this pull request?
   
   This PR improves `ConstantPropagation` rule by extending propagation from 
`attribute => constant` to `expression => constant` mapping and allows 
substituting deterministic expressions to constants in any expression. 
(Previously substitution of attributes only in `EqualTo` and `EqualNullSafe` 
was allowed).
   ```
   SELECT * FROM table WHERE abs(i) = 5 AND j <= abs(i) + 3  =>  ... WHERE 
abs(i) = 5 AND j <= 8
   ```
   
   ## How was this patch tested?
   
   Existing UTs.
   
   

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