andygrove opened a new pull request, #4676: URL: https://github.com/apache/datafusion-comet/pull/4676
## Which issue does this PR close? Part of #4673. ## Rationale for this change The serde framework intends that an expression declares whether it can be accelerated through `getSupportLevel`, with the central dispatcher in `QueryPlanSerde` translating `Incompatible`/`Unsupported` into the appropriate fallback. Several string serdes instead made these decisions inside `convert` by calling `withFallbackReason` directly, even though the decisions are statically determinable from the expression. ## What changes are included in this PR? Move static support decisions out of `convert` and into `getSupportLevel` for the string expressions: - `Substring`: `pos` and `len` must be literals. - `Left`, `Right`: the length argument must be a literal (folded into the existing `getSupportLevel`). - `ConcatWs`: all-foldable arguments fall back so Spark's `ConstantFolding` can handle them. The NULL-separator case still converts directly to a NULL result, so the precedence is preserved in `getSupportLevel`. - `Like`: a custom escape character is unsupported. This is behavior-preserving: every case that previously fell back to Spark continues to fall back with the same reason. The remaining `withFallbackReason` calls in this file are child-reason rollups, which are the intended use inside `convert`. ## How are these changes tested? Covered by existing tests: `CometStringExpressionSuite` (33 tests, including `concat_ws`, `left`, `right`) and `CometExpressionSuite` (`like with custom escape`, `string type and substring`, `substring with start < 1`), which exercise both the supported and fallback paths. -- 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]
