v.19.17New Feature
Created Function Hex for Decimal Numbers
Created functionhexfor Decimal numbers. It works likehex(reinterpretAsString()), but does not delete last zero bytes. #7355 (Mikhail Korotov)
Why it matters
This feature addresses the limitation of the previoushex(reinterpretAsString()) approach, which removed trailing zero bytes in Decimal numbers when converting to hexadecimal. By preserving these zero bytes, the new hex function provides a more accurate and reliable hexadecimal representation of Decimal values.How to use it
Use thehex function directly on Decimal columns or values to obtain their full hexadecimal representation including trailing zeros. For example:SELECT hex(your_decimal_column) FROM your_table;