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

   ## Which issue does this PR close?
   
   Relates to #4500 (item 1: lift `convert`-time fallbacks in 
`arithmetic.scala` into `getSupportLevel`).
   
   ## Rationale for this change
   
   PR #4674 moved the arithmetic and math support checks into `getSupportLevel` 
so that unsupported input types are reported at planning time, where the reason 
surfaces in EXPLAIN output and is picked up by the generated compatibility 
docs. `CometUnaryMinus` was the only arithmetic serde left relying on a 
`convert`-time fallback for unsupported input types: an interval input would 
serialize its child, fail, and fall back with a generic child-level reason 
rather than a clear datatype reason.
   
   This change completes that pattern for `UnaryMinus`.
   
   ## What changes are included in this PR?
   
   - `CometUnaryMinus` now mixes in `MathBase` and overrides `getSupportLevel` 
with `mathDataTypeSupportLevel(expr.child.dataType)`, matching the other 
arithmetic serdes. Every Spark `NumericType` (including decimal) stays native; 
interval types are reported as `Unsupported` with a datatype reason and fall 
back to Spark.
   - Added a `CometExpressionSuite` regression test covering unary minus over 
byte, short, int, long, float, double, and decimal.
   
   ## How are these changes tested?
   
   New test `unary minus across numeric types` in `CometExpressionSuite`, 
passing on Spark 3.5 and 4.0. Behavior was validated with the 
`audit-comet-expression` skill: numeric types (including decimal) run natively 
and match Spark, while day-time and year-month interval inputs fall back to 
Spark.


-- 
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