()
| 173 | |
| 174 | #[test] |
| 175 | fn fold_and_simplify() { |
| 176 | let context = SimplifyContext::builder().with_schema(schema()).build(); |
| 177 | |
| 178 | // What will it do with the expression `concat('foo', 'bar') == 'foobar')`? |
| 179 | let expr = concat(vec![lit("foo"), lit("bar")]).eq(lit("foobar")); |
| 180 | |
| 181 | // Since datafusion applies both simplification *and* rewriting |
| 182 | // some expressions can be entirely simplified |
| 183 | let simplifier = ExprSimplifier::new(context); |
| 184 | let simplified = simplifier.simplify(expr).unwrap(); |
| 185 | assert_eq!(simplified, lit(true)) |
| 186 | } |
| 187 | |
| 188 | #[test] |
| 189 | /// Ensure that timestamp expressions are folded so they aren't invoked on each row |
nothing calls this directly
no test coverage detected
searching dependent graphs…