SPACE function in Apache Hive & Apache Impala

There are some functions that hardly come into use. Often this kind of function would have some other replacement that we use. SPACE is one of the functions introduced by Cloudera’s Impala, which returns the concatenated string to the specified number of spaces.

This function is available in Apache Hive too.

Let’s see what it does.

SELECT SPACE(10);

Result:

SPACE(10)
—————
                 

spacefn_2

Another example:
SELECT CONCAT(‘firstname’, space(1), ‘lastname’); 

spacefn_1

Result:
contact(‘firstname’, space(1), ‘lastname’)
————————————————
firstname lastname


Hope you liked this post.

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