Expand description
Numeric scalar helpers (port of Python _promote_for_addition +
NumericDispatch).
Output type is computed by promotion at bind; process casts the input
column(s) to that type and applies the op via Arrow’s type-preserving
add kernel (covers int / uint / float / decimal uniformly).
Functions§
- add_two
- Add the first two input columns (cast to the bound output type).
- array_
value_ f64 - Read any numeric array element widened to
f64(None if null). - array_
value_ i64 - Read any integer/float array element widened to
i64(None if null). - common_
type_ for_ addition - Common addition type for two inputs: the numeric common type of the two,
then promoted for overflow headroom (matches Python
_promote_for_addition(pc.add(nulls(t1), nulls(t2)).type)). - double_
first - Double the first input column (cast to the bound output type, add to self, cast back so Arrow’s decimal widening doesn’t drift the result type).
- promote_
for_ addition - Promote a numeric type for addition/doubling, matching Python
_promote_for_addition: integers widen to the next size, floats tofloat64, decimals gain one digit of precision (capped at 38).