REVERSE Function in Apache Hive & Apache Impala

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

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.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s