Dandandan commented on pull request #288:
URL: https://github.com/apache/arrow-datafusion/pull/288#issuecomment-835811345


   @msathis
   
   Thanks for this PR!
   
   I believe we should do it a bit differently and not calculate the timestamp 
inside the optimization rule.
   
   One could disable the optimization rule, or execute an un-optimized plan.
   The result of the query needs to be correct in those cases too.
   
   My suggestion would be to set field to the `ExecutionContextState` 
(something like `queryExecutionStartTime`) at the start of a query and pass it 
to the optimizers / evaluation code. This requires maybe some more changes to 
the code, but is needed to correctly run the queries.
   
   For the optimizer you could use `utils::expr_sub_expressions` (see use in 
filter push down) to recurse into the expressions and replace *all* cases of 
the `NOW` with the timestamp of the start of the query.
   
   


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


Reply via email to