mod(dividend: int64, divisor: int64) -> int64

Returns the int64 remainder after dividing dividend by divisor (the sign of the result follows the dividend, consistent with the usual modulo semantics on integers). If either operand is null, the result is null. A zero divisor yields null at evaluation time; if the divisor is the compile-time constant zero, compilation fails instead of producing a constant result. Integer division without the remainder is int_div.

Domain

This is a scalar function (calculates a single output value for a single input row).

Categories

Examples

make_col shard:mod(@.user_id, 128)

Maps each integer user identifier into one of 128 shards using the remainder after division.

make_col phase:mod(@.sequence, 3)

Assigns a repeating phase index of zero, one, or two for load-balancing work across three lanes.