andygrove opened a new pull request, #4674:
URL: https://github.com/apache/datafusion-comet/pull/4674

   ## 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. The arithmetic and math serdes instead made these decisions inside 
`convert` by calling `withFallbackReason` directly, even though the decisions 
are statically determinable from the expression. Moving them to 
`getSupportLevel` keeps fallback decisions declared in one place.
   
   ## What changes are included in this PR?
   
   Move static support decisions out of `convert` and into `getSupportLevel` 
for the arithmetic and math expressions:
   
   - `Add`, `Subtract`, `Multiply`, `Divide`, `IntegralDivide`, `Remainder`: 
the unsupported-data-type check (shared via a new 
`MathBase.mathDataTypeSupportLevel` helper) now returns `Unsupported`.
   - `Round`: negative decimal scale and float/double (BigDecimal rounding) now 
return `Unsupported` from `getSupportLevel`.
   - `Ceil`, `Floor`: negative decimal scale now returns `Unsupported` from 
`getSupportLevel`.
   
   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 these files are child-reason rollups, which are the intended use 
inside `convert`.
   
   ## How are these changes tested?
   
   Covered by existing tests in `CometExpressionSuite` (`ceil and floor`, 
`basic arithmetic`, `ANSI support for round function`, `decimals arithmetic and 
comparison`, `scalar decimal arithmetic operations`), 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]

Reply via email to