Case Conversion in Apache Hive & Apache Impala

Apache Hive provides many features that SQL developers are familiar with. The behavior in much of the functions is the same. Such functions help to interpret, translate, quantify and format data.

The aim of this post is to let you know the functions that help view data in various character cases, such as Uppercase, Lowercase and Title case.

  • Note: The below specified functions are common in both Apache Hive & Apache Impala.

The Apache Hive UPPER function converts all string letters to upper case, and the LOWER function converts all string letters to lower case. You will use the InitCap function to convert the letters into the Proper Case/Title case.

Refer to the below examples:

SELECT UPPER(‘This is posted on BIGDATAnSQL blog’);
This converts the input string characters into capital letters.

SELECT LOWER(‘This is posted on BIGDATAnSQL blog’);

This converts the input string characters into lowercase letters.

SELECT InitCap(‘This is posted on BIGDATAnSQL blog’);

This converts the input string characters into title case / proper case letters.

Lower_Upper_Titlecase

Hope you liked this post.

Please click on the follow button to receive updates on latest posts.

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