andygrove opened a new issue, #4673: URL: https://github.com/apache/datafusion-comet/issues/4673
## Background The serde framework intends that an expression declares whether it can be accelerated through `getSupportLevel`, which returns `Compatible`, `Incompatible`, or `Unsupported`. The central dispatcher in `QueryPlanSerde` then translates `Incompatible`/`Unsupported` into the appropriate `withFallbackReason` fallback. Several `CometExpressionSerde.convert` (and `CometAggregateExpressionSerde.convert`) implementations instead call `withFallbackReason` directly for decisions that are statically determinable from the expression (data types, negative decimal scale, whether an argument is a literal/foldable, etc.). Those decisions belong in `getSupportLevel`. Calling `withFallbackReason` inside `convert` is only appropriate when rolling up child fallback reasons after a child failed to convert, or when the decision genuinely cannot be made until conversion is attempted. Note that `getSupportLevel(expr)` receives only the expression: checks that need `inputs`/`binding` (for example resolving an attribute against the input schema) must remain in `convert`. ## Scope Move static support decisions out of `convert` and into `getSupportLevel` across the expression and aggregate serdes. This is a behavior-preserving refactor: each case that previously fell back to Spark continues to fall back with the same reason. This will be done as a series of PRs grouped by serde domain: - [ ] Arithmetic and math expressions (`arithmetic.scala`, `math.scala`) - [ ] String expressions (`strings.scala`) - [ ] Array expressions (`arrays.scala`) - [ ] Aggregate expressions (`aggregates.scala`) - [ ] Misc scalar serdes (`namedExpressions.scala`, `unixtime.scala`, `contraintExpressions.scala`) The cast path (`CometCast`) and the operator/scan/rule layers are out of scope: they do not have a `getSupportLevel(expr)` hook. -- 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]
