v.23.10New Feature

Added byteSwap Function for Reversing Unsigned Integer Bytes

Added function byteSwap which reverses the bytes of unsigned integers. This is particularly useful for reversing values of types which are represented as unsigned integers internally such as IPv4. #55211 (Priyansh Agrawal).
Added the byteSwap function to ClickHouse, which reverses the byte order of unsigned integer values.

Why it matters

The byteSwap function addresses the need to reverse byte sequences in unsigned integer types, such as IPv4 addresses. This helps in scenarios where byte order manipulation is required for correct data interpretation or processing.

How to use it

Use the byteSwap function in your queries by passing an unsigned integer value to it. For example:

SELECT byteSwap(your_unsigned_integer_column) FROM your_table;