REVERSE Function in Apache Hive & Apache Impala

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

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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