Convert Ascii value to character in hive

I want to convert the ascii value to my character in hive.Is there is any existing function in the hive (for example we have a char function in SQL server). Does anyone know how to achieve this in a hive?

Example: for 65, the result is A.

Thanks in advance.


source to share

1 answer

This is possible by combining several built-in functions:

Select decode(unhex(hex(65)), 'US-ASCII');



changes the int value to a hexadecimal string and unhex

changes that to binary. then decode

interprets the binary as ASCII data.



All Articles