This is an automated email from the ASF dual-hosted git repository.

alamb pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/arrow-datafusion.git


The following commit(s) were added to refs/heads/master by this push:
     new 703c789  *: remove duplicate test (#2089)
703c789 is described below

commit 703c789898aad5560c47e954e2ff5e1c127f743a
Author: jakevin <[email protected]>
AuthorDate: Sat Mar 26 00:56:19 2022 +0800

    *: remove duplicate test (#2089)
---
 datafusion/src/optimizer/simplify_expressions.rs | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/datafusion/src/optimizer/simplify_expressions.rs 
b/datafusion/src/optimizer/simplify_expressions.rs
index 5927810..8e1e7d3 100644
--- a/datafusion/src/optimizer/simplify_expressions.rs
+++ b/datafusion/src/optimizer/simplify_expressions.rs
@@ -1034,6 +1034,11 @@ mod tests {
         let expr = call_fn("to_timestamp", vec![col("a")]).unwrap();
         test_evaluate(expr.clone(), expr);
 
+        // check that non foldable arguments are folded
+        // to_timestamp(a) --> to_timestamp(a) [no rewrite possible]
+        let expr = call_fn("to_timestamp", vec![col("a")]).unwrap();
+        test_evaluate(expr.clone(), expr);
+
         // volatile / stable functions should not be evaluated
         // rand() + (1 + 2) --> rand() + 3
         let fun = BuiltinScalarFunction::Random;
@@ -1046,7 +1051,6 @@ mod tests {
         // parenthesization matters: can't rewrite
         // (rand() + 1) + 2 --> (rand() + 1) + 2)
         let fun = BuiltinScalarFunction::Random;
-        assert_eq!(fun.volatility(), Volatility::Volatile);
         let rand = Expr::ScalarFunction { args: vec![], fun };
         let expr = (rand + lit(1)) + lit(2);
         test_evaluate(expr.clone(), expr);

Reply via email to