적용 대상:
Databricks SQL
Databricks Runtime 13.3 LTS 이상
버킷 내에서 주어진 BIGINT 숫자의 0 기준 비트 위치를 반환합니다.
bitmap_bucket_number() 함수와 함께 모든 BIGINT 숫자를 고유하게 식별합니다.
구문
bitmap_bit_position(expr)
인수
-
expr:BIGINT식입니다.
반품
BIGINT 0에서 32767 사이입니다.
expr 결과가 일치하는 경우 >0 : (expr - 1) % 32768.
expr 결과가 일치하는 경우 <= 0 : abs(expr) % 32768.
예제
> SELECT bitmap_bucket_number(1), bitmap_bit_position(1);
1 0
> SELECT bitmap_bucket_number(32768), bitmap_bit_position(32768);
1 32767
> SELECT bitmap_bucket_number(32769), bitmap_bit_position(32769);
2 0
> SELECT bitmap_bucket_number(0), bitmap_bit_position(0);
0 0
> SELECT bitmap_bucket_number(-32767), bitmap_bit_position(-32767);
0 32767
> SELECT bitmap_bucket_number(-32768), bitmap_bit_position(-32768);
-1 0