shiftleft function
Applies to: Databricks SQL
Databricks Runtime
Returns expr bitwise left shifted by n bits. This function is a synonym for << (lt lt sign) operator.
Syntax
shiftleft(expr, n)
Arguments
expr: AnINTEGERorBIGINTexpression.n: AnINTEGERexpression.
Returns
The result matches the type of expr.
The effective shift distance is n modulo 32 for an INTEGER expr and modulo 64 for a BIGINT expr.
Examples
SQL
> SELECT shiftleft(2, 1);
4
> SELECT shiftleft(1, -1);
-2147483648
> SELECT 2 << 1;
4