v.20.3New Feature

Implement Bitwise Operations for FixedString Datatype

Implement bitAnd, bitOr, bitXor, bitNot for FixedString(N) datatype. #9091 (Guillaume Tassery)
Implemented bitwise functions bitAnd, bitOr, bitXor, and bitNot for the FixedString(N) datatype in ClickHouse.

Why it matters

These additions allow users to perform bitwise operations directly on FixedString columns, enabling more efficient and expressive low-level data manipulations and binary processing within ClickHouse. Previously, such operations were not supported for the FixedString(N) type, limiting usage scenarios where bitwise logic on fixed-size byte sequences is needed.

How to use it

Use the functions bitAnd, bitOr, bitXor, and bitNot directly in SQL queries on columns of type FixedString(N). For example:

SELECT bitAnd(fixed_string_column, 'value') FROM table;


These work as usual bitwise operators but are now fully compatible with FixedString(N) types without requiring type casting.