Printf Function in Apache Hive

The PRINTF function returns the formatted input according to the printf-style format string. When using hive scripts, this would be beneficial.

Syntax: printf(String format, Obj… args)

Example:
SELECT PRINTF(‘hello’)
This returns “hello” as output.

printf in hive

While using the Hive scripts, it can be added as follows:

printf_hivescript

printf_samplesql_output

2 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