div
operator
Returns the integral part of the division of divisor
by dividend
.
Arguments
divisor
: An expression that evaluates to a numeric or interval.dividend
: A matching interval type ifdivisor
is an interval, a numeric otherwise.
Interval is supported Since: Databricks Runtime 10.1
Returns
A BIGINT
If dividend
is 0
, INTERVAL '0' SECOND
or INTERVAL '0' MONTH
the operator raises a DIVIDE_BY_ZERO error.
Note
If spark.sql.ansi.enabled is false
the function returns NULL
instead of an error division by 0.