Commonly used Apache Hive Interactive Shell Command Options and Examples

  • Post author:
  • Post last modified:February 26, 2018
  • Post category:BigData
  • Reading time:3 mins read

You can use the Hive Interactive shell command options to add JAR or resource files, set variables, display list of resource files and delete them when not required. Hive interactive shell provides various option. You can even execute shell or linux commands from Hive interactive shell without actually leaving Hive shell. For ad hoc queries and data exploration, you can submit SQL statements in an interactive session. You can add the UDF JAR files to the Hive using Apache Hive interactive shell command options.

Read:

Apache Hive interactive shell command options

In this article, we will check Hive interactive shell command options and examples.

Hive Interactive Shell Command Options

Below are the Hive interactive shell command options:

Hive Interactive shell commands Description
quit or exit Quit or exit the interactive shell
set key=value Used to set value of particular configuration variable. Variable name should exactly match when using.
set Print a list of configuration variables that are overridden by user or hive.
set -v Print all Hadoop and hive configuration variables.
add FILE[S] [file] [file]* Adds a file to the list of resources.
add JAR [S] [file] [file]* Add JAR files to hive class path. Example is, adding UDFs JARs
list FILE Display all added files
list JAR  
delete FILE[S] JAR[S]  
! [cmd] Executes a shell command from the hive shell
dfs [dfs cmd] Execute Hadoop dfs commands from Hive interactive shell
[query] Execute given query and display results.
source FILE Used to execute a script file inside the CLI

Apche Hive Interactive shell command Options Usage and Examples

 hive> set mapred.reduce.tasks=32;
hive> set;
hive> select a.* from tab1;
hive> !ls;
hive> dfs -ls;
hive> exit;

Read: