REVERSE(STRING a)
The REVERSE function accepts a character expression as its argument, and returns a string of the same length, but the ordinal position of each logical character is reversed. However, this only works for STRING.
This function and its behaviour is same in both Apache Hive & Impala
Example:
SELECT REVERSE(‘slipknot’);
In case if you want to reverse a number, convert it into or pass it as a string.
SELECT REVERSE(‘123456789’);
Hope you find this article helpful.
4 comments