...
Running Hive CLI
To use the Hive command line interface (CLI) from the shell:
No Format |
---|
$ $HIVE_HOME/bin/hive |
Running HiveServer2 and
...
Beeline
HiveServer2 (introduced in Hive 0.11) has its own CLI called Beeline. HiveCLI is now deprecated in favor of Beeline, as it lacks the multi-user, security, and other capabilities of HiveServer2. To run HiveServer2 and Beeline from shell:
...
- Hive configuration can be manipulated by:
- Editing hive-site.xml and defining any desired variables (including Hadoop variables) in it
- From Using the CLI using the set command (see belownext section)
- Invoking Hive (deprecated), Beeline or Hiveserver2 HiveServer2 using the syntax:
$ bin/hive --hiveconf x1=y1 --hiveconf x2=y2 //this sets the variables x1 and x2 to y1 and y2 respectively
- $ bin/hiveserver2 --hiveconf x1=y1 --hiveconf x2=y2 //this sets a server-side variable variables x1 and x2 to y1 and y2 respectively
- $ bin/beeline --hiveconf x1=y1 --hiveconf x2=y2 //this sets a client-side variable variables x1 and x2 to y1 and y2 respectively.
- Setting the
HIVE_OPTS
environment variable to "--hiveconf x1=y1 --hiveconf x2=y2
" which does the same as above.
...