-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Description
Description:
Part of #3869
Description
Spark's % (remainder/modulo) operator supports decimal types, but Velox currently
only has remainder for integer and floating-point types — not for decimals.
In Spark's ANSI mode (spark.sql.ansi.enabled=true), decimal remainder should raise
an error on division by zero rather than returning null. This requires both a regular
and a checked variant.
This follows the same pattern established by:
- Add checked_add and checked_subtract for Spark decimal types #16301 / PR feat: Support decimal type for the Spark checked_add and checked_subtract functions #16302 —
checked_addandchecked_subtractfor decimal - Add checked_multiply for Spark decimal types #16306 / PR feat: Support decimal type for Spark checked_multiply function #16307 —
checked_multiplyfor decimal - Add checked_divide for Spark decimal types" #16322 / PR feat: Add checked_divide for Spark decimal arithmetic #16323 —
checked_dividefor decimal
Scope
remainderfor all decimal input combinations (short/long × short/long)checked_remainderfor all decimal input combinations- Both
allowPrecisionLossanddenyPrecisionLossvariants - Division by zero: null (non-checked) / throw (checked)
- int128 fast path with int256 fallback for rescaling overflow
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request