getbit
function
Applies to: Databricks SQL
Databricks Runtime 10.0 and above
Returns the value of a bit in a binary representation of an integral numeric.
Arguments
expr
: An expression that evaluates to an integral numeric.pos
: An expression of type INTEGER.
Returns
The result type is INTEGER.
The result value is 1 if the bit is set, 0 otherwise.
Bits are counted right to left and 0-based.
If pos
is outside the bounds of the data type of expr
Databricks SQL raises an error.
getbit
is a synonym of bit_get.