Part of #5572.
abs on an interval falls the whole projection back to Spark:
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:
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.
Part of #5572.
abson an interval falls the whole projection back to Spark:spark/src/main/scala/org/apache/comet/serde/math.scala:178-184The comment already names the gap.
docs/source/user-guide/latest/expressions.mdrecords it as "Interval types fall back".Both interval families are explicitly supported by the dispatcher's type surface:
spark/src/main/scala/org/apache/comet/codegen/CometBatchKernelCodegen.scala:92so
canHandleadmitsabs(interval_col)and Spark's owndoGenCodegives the ANSI overflow behavior forLong.MinValuemicros for free — which is worth having, since that is exactly the edge a native implementation would need to get right.Fix: mix
CodegenDispatchFallbackintoCometAbs.