davidlghellin commented on code in PR #22959:
URL: https://github.com/apache/datafusion/pull/22959#discussion_r3416521023
##########
datafusion/sqllogictest/test_files/spark/string/concat_ws.slt:
##########
@@ -385,3 +385,73 @@ x,1,2,y
## Struct argument is rejected (not coerced to string)
query error
SELECT concat_ws(',', named_struct('a', 1));
+
+## ── Plan-time simplifications ───────────────────────────────
+
+## Folded by simplify() — ConstEvaluator can't (mixed literal + column).
+query TT
+EXPLAIN SELECT concat_ws(CAST(NULL AS STRING), a, b) AS r FROM VALUES ('x',
'y'), ('p', 'q') AS t(a, b);
+----
+logical_plan
+01)Projection: Utf8(NULL) AS r
+02)--SubqueryAlias: t
+03)----Projection:
+04)------Values: (Utf8("x"), Utf8("y")), (Utf8("p"), Utf8("q"))
+physical_plan
+01)ProjectionExec: expr=[NULL as r]
+02)--DataSourceExec: partitions=1, partition_sizes=[1]
Review Comment:
Acknowledged. Kept the physical plan details because they confirm the actual
optimization win (no `concat_ws` in `ProjectionExec`, no columns scanned in
`DataSourceExec`) — `...` wildcards would let a regression through silently.
Matches the repo convention for `EXPLAIN` cases (see
`simplify_expressions.slt`, `aggregate.slt`). When optimizer formatting shifts,
the expected output gets updated as part of that PR.
--
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]