Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: add link to Variable Substitution doc; change {code} to {noformat}

...

To get help, run "hive -H" or "hive --help".
Usage (as it is in Hive 0.9.0):

Code Blocknoformat
usage: hive
 -d,--define <key=value>          Variable substitution to apply to hive
                                  commands. e.g. -d A=B or --define A=B
 -e <quoted-query-string>         SQL from command line
 -f <filename>                    SQL from files
 -H,--help                        Print help information
 -h <hostname>                    Connecting to Hive Server on remote host
    --hiveconf <property=value>   Use value for given property
    --hivevar <key=value>         Variable substitution to apply to hive
                                  commands. e.g. --hivevar A=B
 -i <filename>                    Initialization SQL file
 -p <port>                        Connecting to Hive Server on port number
 -S,--silent                      Silent mode in interactive shell
 -v,--verbose                     Verbose mode (echo executed SQL to the
                                  console)

See Variable Substitution for examples of using the hiveconf option.

Info
titleVersion information

As of Hive 0.10.0 there is one additional command line option:

Code Block
--database               Specify the database to use

...

Command

Description

quit
exit

Use quit or exit to leave the interactive shell.

reset

Resets the configuration to the default values (as of Hive 0.10: see HIVE-3202).

set <key>=<value>

Sets the value of a particular configuration variable (key).
Note: If you misspell the variable name, the CLI will not show an error.

set

Prints a list of configuration variables that are overridden by the user or Hive.

set -v

Prints all Hadoop and Hive configuration variables.

<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="b59ae83e67464b38-2277f207-418a4615-8cdcb25d-5979b864a07be53ba6110ad8"><ac:plain-text-body><![CDATA[

add FILE[S] <filepath> <filepath>*
]]></ac:plain-text-body></ac:structured-macro>
<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="526bbeeb07f61a68-a840147f-4a6e4cb2-8baabec6-8911a91eb33678dfb71a7835"><ac:plain-text-body><![CDATA[add JAR[S] <filepath> <filepath>*
]]></ac:plain-text-body></ac:structured-macro>
<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="ddf9e441f3787f04-c5fbf9c3-498045bb-b5868c55-1894e9d4ee7a6428c2bfa46a"><ac:plain-text-body><![CDATA[add ARCHIVE[S] <filepath> <filepath>*

Adds one or more files, jars, or archives to the list of resources in the distributed cache.

]]></ac:plain-text-body></ac:structured-macro>

<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="c4b64d925337fbf2-957c66c7-4bfc451b-948c926c-0a3051fcc19dc5e696d85770"><ac:plain-text-body><![CDATA[

list FILE[S]
]]></ac:plain-text-body></ac:structured-macro>
<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="3153f5161e6aa7d0-969d5e48-496d4c04-94fda550-7e6c31d9b4ca04c2cfbf5381"><ac:plain-text-body><![CDATA[list JAR[S]
]]></ac:plain-text-body></ac:structured-macro>
<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="55f2538be2a6c25c-288feb41-47d4473d-9cb8be6e-a89399551e3a0715cb283913"><ac:plain-text-body><![CDATA[list ARCHIVE[S]

Lists the resources already added to the distributed cache.

]]></ac:plain-text-body></ac:structured-macro>

<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="0810c18da145883a-02482527-4a3d4047-8ee28fce-24319b10642c0fd7b2218b52"><ac:plain-text-body><![CDATA[

list FILE[S] <filepath>*
]]></ac:plain-text-body></ac:structured-macro>
<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="d4f4ee66b74413e8-8ac5eda5-40a14753-8678ba28-14eaafe6e1951bb3ffa7cfc4"><ac:plain-text-body><![CDATA[list JAR[S] <filepath>*
]]></ac:plain-text-body></ac:structured-macro>
<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="85082d9d23f08cc6-f63c2a14-45974542-89a3810a-da8f041156beb2c2e75fa2b4"><ac:plain-text-body><![CDATA[list ARCHIVE[S] <filepath>*

Checks whether the given resources are already added to the distributed cache or not.

]]></ac:plain-text-body></ac:structured-macro>

<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="e52b3e3f188f12e6-059cde73-4559460d-ab1ab80f-397b7c33a513904301b090fa"><ac:plain-text-body><![CDATA[

delete FILE[S] <filepath>*
]]></ac:plain-text-body></ac:structured-macro>
<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="6e9e96a1768bd4b0-b54dc796-43664ac3-ba1487d8-249b9f2d7c75a62a092635e5"><ac:plain-text-body><![CDATA[delete JAR[S] <filepath>*
]]></ac:plain-text-body></ac:structured-macro>
<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="0a3f7859fd690893-b77f13b4-4d864e2c-937ca7fe-a4c46fdc955e4500724c8f77"><ac:plain-text-body><![CDATA[delete ARCHIVE[S] <filepath>*

Removes the resource(s) from the distributed cache.

]]></ac:plain-text-body></ac:structured-macro>

! <command>

Executes a shell command from the Hive shell.

dfs <dfs command>

Executes a dfs command from the Hive shell.

<query string>

Executes a Hive query and prints results to standard output.

source FILE <filepath>

Executes a script file inside the CLI.

...