alamb commented on code in PR #3684:
URL: https://github.com/apache/arrow-datafusion/pull/3684#discussion_r992253421
##########
datafusion/optimizer/src/simplify_expressions.rs:
##########
@@ -1352,6 +1396,30 @@ mod tests {
}
}
+ #[test]
+ fn test_simplify_concat() {
+ fn build_concat_expr(args: &[Expr]) -> Expr {
+ Expr::ScalarFunction {
+ fun: BuiltinScalarFunction::Concat,
+ args: args.to_vec(),
+ }
+ }
+
+ let null = Expr::Literal(ScalarValue::Utf8(None));
+ let expr = build_concat_expr(&[
+ null.clone(),
+ col("c0"),
+ lit("hello "),
+ null.clone(),
+ lit("rust"),
+ col("c1"),
+ lit(""),
+ null,
+ ]);
+ let expected = build_concat_expr(&[col("c0"), lit("hello rust"),
col("c1")]);
Review Comment:
this is very clever
--
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]