Starting Apache Hive
Also available as:
PDF

Run a Hive command

You can run most Hive commands by using the hive keyword, which runs Beeline in the background, followed by the Hive command.

Hive 3 and later support only Beeline for running Hive commands from the command line. In the task below, you start Beeline in the background and enter the -e flag followed by a Hive command that lists system variables.

The following components are running:
  • HiveServer
  • Hive clients
  • You have a network connection to Beeline.
  1. On a node in your cluster, enter the hive command to send configuration properties to standard output.
    > hive -e set
    All obsolete Hive CLI commands are supported on the Beeline command line except set key=value commands that configure Hive metastore.
  2. At the prompt, enter your user name and password for accessing Hive.
    The output includes the system variable settings:
    +----------------------------------------------------------------+
    |                        set                                     |
    +----------------------------------------------------------------+
    | _hive.hdfs.session.path=/tmp/hive/hive/91ecb...00a             |
    | _hive.local.session.path=/tmp/hive/91ecb...00a                 |
    | _hive.tmp_table_space=/tmp/hive/hive/91ecb...00a/_tmp_space.db |
    | ambari.hive.db.schema.name=hive                                |
    | atlas.hook.hive.maxThreads=1                                   |
     ...