You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2021/10/27 13:03:31 UTC

[GitHub] [arrow-datafusion] alamb commented on issue #1160: Support simplification that requires multiple applications of constant folding / simplification

alamb commented on issue #1160:
URL: https://github.com/apache/arrow-datafusion/issues/1160#issuecomment-952905624


   @rdettai  I think it is still relevant (though the `now()` example will work after #1175)
   
   One (silly) example
   ```
   (expr != NULL) OR (5 > 10)
   ```
   
   We need to apply at least one pass twice to fully simplify
   
   ```
   (expr != NULL) OR (5 > 10)
   (expr != NULL) OR FALSE # after constant evaluation
   NULL OR FALSE           # after simplify
   NULL                    # after second constant evaluation
   ```
   
   In this this case if we applied simplify first and then constant evaluation the expression would be folded completely
   
   However, for other examples if you apply simplification first that is insufficient
   ```
   expr != (5 > NULL)
   expr != (5 > NULL) # after simplification
   expr != NULL       # after constant evaluation
   ```
   
   (would need a second call to simplify now)
   
   


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org