andygrove opened a new issue, #5587:
URL: https://github.com/apache/datafusion-comet/issues/5587

   Part of #5572.
   
   `abs` on an interval falls the whole projection back to Spark:
   
   ```scala
   case _: NumericType =>
     Compatible()
   case _ =>
     // Spark supports NumericType, DayTimeIntervalType, and 
YearMonthIntervalType
     Unsupported(Some(unsupportedReason))
   ```
   
   `spark/src/main/scala/org/apache/comet/serde/math.scala:178-184`
   
   The comment already names the gap. 
`docs/source/user-guide/latest/expressions.md` records it as "Interval types 
fall back".
   
   Both interval families are explicitly supported by the dispatcher's type 
surface:
   
   ```scala
   case _: YearMonthIntervalType | _: DayTimeIntervalType | 
CalendarIntervalType => true
   ```
   
   
`spark/src/main/scala/org/apache/comet/codegen/CometBatchKernelCodegen.scala:92`
   
   so `canHandle` admits `abs(interval_col)` and Spark's own `doGenCode` gives 
the ANSI overflow behavior for `Long.MinValue` micros for free — which is worth 
having, since that is exactly the edge a native implementation would need to 
get right.
   
   Fix: mix `CodegenDispatchFallback` into `CometAbs`.
   


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