Finding the length of a string – Apache Hive & Apache Impala

The LENGTH() function returns the length of a string. Both leading and trailing spaces at the begin and end of the string is included when calculating the length. 

  • Note: The below specified function is common in both Apache Hive & Apache Impala.

Syntax: LENGTH(String)
This accepts both characters and numbers in the input but returns INT value.

Examples:
length function in hive

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