snowflake.snowpark.functions.bitmap_bit_position¶
- snowflake.snowpark.functions.bitmap_bit_position(numeric_expr: Union[Column, str]) Column [source]¶
Returns the position of the first set bit (i.e., the first ‘1’ bit) in the binary representation of the input number.
Example:
>>> df = session.create_dataframe([1, 2, 3, 32768, 32769], schema=["a"]) >>> df.select(bitmap_bit_position("a").alias("bit_position")).collect() [Row(BIT_POSITION=0), Row(BIT_POSITION=1), Row(BIT_POSITION=2), Row(BIT_POSITION=32767), Row(BIT_POSITION=0)]