andygrove commented on PR #3542:
URL:
https://github.com/apache/datafusion-comet/pull/3542#issuecomment-3920987595
Thanks for the fix, @0lai0! The null separator handling is clean.
I pushed a small addition to handle the case where all `concat_ws` arguments
are foldable (literals). Without this, queries like `SELECT concat_ws(',',
'hello', 'world')` would still crash the native engine when `ConstantFolding`
is disabled, since the native `concat_ws` doesn't support all-scalar inputs.
This was the query that was `ignore`d in the test file referencing #3339.
The new case in `CometConcatWs.convert` checks
`expr.children.forall(_.foldable)` and returns `None` to fall back to Spark. I
also updated the test from `query ignore(...)` to `query spark_answer_only` so
it actually runs and verifies correctness.
Note that the null separator check still comes first, so `concat_ws(NULL,
'a', 'b')` is handled by the existing null-literal short-circuit before the
foldable check is reached.
--
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]