Details
-
Sub-task
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
Description
Implement bit_count function
MySQL BIT_COUNT: https://dev.mysql.com/doc/refman/8.4/en/bit-functions.html#bit-operations-bit-count
Examples:
Expression | Result |
---|---|
bitcount(0) | 0 |
bitcount(1) | 1 |
bitcount(39) | 4 |
bitcount(cast(x'ad') as BINARY(1))) | 5 |
bitcount(-1) | 64 |
MySQL will handle decimal values as unsigned long values. For decimal values, only the integer portion is examined.
Expression | Result |
---|---|
bit_count(5.23) | 2 |
bit_count(18446744073709551615) | 64 |
bit_count(18446744073709551616) | 63 |
bit_count(18446744073709551617) | 63 |
bit_count(-9223372036854775808) | 1 |
bit_count(-9223372036854775809) | 1 |
Attachments
Issue Links
- Blocked
-
CALCITE-5087 Support bitwise operators
- Open
- is related to
-
CALCITE-3732 Implement bit functions and operators
- In Progress
- links to