You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug] try_mod falls back to Spark because CometRemainder rejects EvalMode.TRY #4484
try_mod (Spark 4.0+) is RuntimeReplaceable and rewrites to Remainder(left, right, EvalMode.TRY). Comet's CometRemainder serde explicitly rejects EvalMode.TRY with withInfo(expr, "Eval mode TRY is not supported") and returns None, so the enclosing plan falls back to Spark.
The sibling arithmetic serdes (CometAdd, CometSubtract, CometMultiply, CometDivide, CometIntegralDivide) all accept EvalMode.TRY by propagating the mode through evalModeToProto, and the Rust spark_modulo UDF already takes a fail_on_error: bool flag, so there is no semantic obstacle to letting EvalMode.TRY through.
Surfaced by the math-expressions audit (collection PR queue).
CometRemainder should accept EvalMode.TRY the same way the other arithmetic serdes do (TRY currently behaves identically to LEGACY at the Rust layer, returning NULL on divide-by-zero).
Additional context
Comet serde: CometRemainder in spark/src/main/scala/org/apache/comet/serde/arithmetic.scala
Activity
marvelshan commentedon Jun 10, 2026
take