...
- Hive configuration can be manipulated by:
- Editing hive-site.xml and defining any desired variables (including Hadoop variables) in it
- From the CLI using the set command (see below)
- Invoking hive Hive (deprecated), Beeline or 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 x1 and x2 to y1 and y2 respectively
- $ bin/beeline --hiveconf x1=y1 --hiveconf x2=y2 //this sets a client-side variable 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.
...
- Hive queries are executed using map-reduce queries and, therefore, the behavior of such queries can be controlled by the Hadoop configuration variables.
The CLI HiveCLI (deprecated) and Beeline command 'SET' can be used to set any Hadoop (or Hive) configuration variable. For example:
No Format hive>beeline> SET mapred.job.tracker=myhost.mycompany.com:50030; hive>beeline> SET -v;
The latter shows all the current settings. Without the
-v
option only the variables that differ from the base Hadoop configuration are displayed.
...