Skip to content

Function byteSwap #54734

@alexey-milovidov

Description

@alexey-milovidov

Use case

If a number was in big-endian instead of little-endian, or vice versa, convert it back.

Example:

Instead of writing:

SELECT toIPv4(reinterpretAsUInt32(reverse(reinterpretAsFixedString(3351772109))))

I want to write:

SELECT toIPv4(byteSwap(3351772109))

Describe the solution you'd like

Implement this function for integer types.

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions