log2
function
Applies to: Databricks SQL
Databricks Runtime
Returns the logarithm of expr
with base 2
.
log2(expr)
expr
: An expression that evaluates to a numeric.
A DOUBLE.
If expr is less than or equal to 0 the result is NULL.
> SELECT log2(2);
1.0