Executing HiveQL Script from CLI in different modes

The purpose of this article is to explore interactive and non-interactive modes of execution of the SQL file to retrieve records from the Hive metastore through the command line interface.

Non-Interactive Mode:
The below command executes a SQL file in non-interactive mode. This type of execution is used for batch processing where no user’s input is required.

hive -f sample.sql

Non_Interactive

Interactive Mode:
The below command executes a SQL file in before entering interactive mode. Look at the below example, once the script is executed, it redirects to the interactive mode.

hive -i sample.sql

Interactive

Hope you find this article helpful.

Please do follow for more interesting updates.

One comment

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