Jefffrey commented on code in PR #19426:
URL: https://github.com/apache/datafusion/pull/19426#discussion_r2637509458
##########
datafusion/optimizer/src/simplify_expressions/simplify_exprs.rs:
##########
@@ -1073,4 +1073,34 @@ mod tests {
"
)
}
+
+ #[test]
+ fn test_evaluate_stable_expressions_enabled_by_default() -> Result<()> {
+ // By default, stable expressions like now() should be simplified to
literals
+ let time = Utc::now();
+
+ // With default config, evaluate_stable_expressions should be true
+ let config =
OptimizerContext::new().with_query_execution_start_time(time);
+ assert!(
+ config.options().optimizer.evaluate_stable_expressions,
+ "evaluate_stable_expressions should be true by default"
+ );
+ Ok(())
+ }
+
+ #[test]
+ fn test_evaluate_stable_expressions_disabled() -> Result<()> {
Review Comment:
nit: I don't think this test is particularly useful, can probably just
remove it
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]