Index: docs/xdocs/language_manual/cli.xml
===================================================================
--- docs/xdocs/language_manual/cli.xml (revision 1375866)
+++ docs/xdocs/language_manual/cli.xml (working copy)
@@ -21,41 +21,76 @@
Usage: $HIVE_HOME/bin/hive is a shell utility which can be used to run Hive queries in either interactive or batch mode. To get help, run " Usage (as it is in Hive 0.9.0): As of Hive 0.10.0 there is one additional command line option: The CLI when invoked without the
-The cli when invoked without the -i option will attempt to load HIVE_HOME/bin/.hiverc and $HOME/.hiverc as initialization files.
- When Examples are shown above in Command Examples. When Use ";" (semicolon) to terminate commands. Comments in scripts can be specified using the "--" prefix.
-Hive uses log4j for logging. These logs are not emitted to the standard output by default but are instead captured to a log file specified by Hive's log4j properties file. By default Hive will use hive-log4j.default in the conf/ directory of the hive installation which writes out logs to /tmp/$USER/hive.log and uses the WARN level.
-
-It is often desirable to emit the logs to the standard output and/or change the logging level for debugging purposes. These can be done from the command line as follows: Hive uses log4j for logging. These logs are not emitted to the standard output by default but are instead captured to a log file specified by Hive's log4j properties file. By default Hive will use It is often desirable to emit the logs to the standard output and/or change the logging level for debugging purposes. These can be done from the command line as follows:
-hive.root.logger specifies the logging level as well as the log destination. Specifying console as the target sends the logs to the standard error (instead of the log file).
+
+
-Hive can manage the addition of resources to a session where those resources need to be made available at query execution time. Any locally accessible file can be added to the session. Once a file is added to a session, hive query can refer to this file by its name (in map/reduce/transform clauses) and this file is available locally at execution time on the entire hadoop cluster. Hive uses Hadoop's Distributed Cache to distribute the added files to all the machines in the cluster at query execution time. Hive can manage the addition of resources to a session where those resources need to be made available at query execution time. The resources can be files, jars, or archives. Any locally accessible file can be added to the session. Once a resource is added to a session, Hive queries can refer to it by its name (in map/reduce/transform clauses) and the resource is available locally at execution time on the entire Hadoop cluster. Hive uses Hadoop's Distributed Cache to distribute the added resources to all the machines in the cluster at query execution time. Example It is not neccessary to add files to the session if the files used in a transform script are already available on all machines in the hadoop cluster using the same path name. For example: It is not neccessary to add files to the session if the files used in a transform script are already available on all machines in the Hadoop cluster using the same path name. For example:Hive Cli
-
+
-hive -H" or "hive --help".Version Information: Hive 0.10.0
+
-
+-i option will attempt to load $HIVE_HOME/bin/.hiverc and $HOME/.hiverc as initialization files.$HIVE_HOME/bin/hive is run with the -e or -f option, it executes SQL commands in batch mode.
+
+hive -e '<query-string>' executes the query string.hive -f <filepath> executes one or more SQL queries from a file.$HIVE_HOME/bin/hive is run without either the -e or -f option, it enters interactive shell mode.
-Sample Usage:
+
-
Command
-Description
+Command
+Description
-
quit
+quitexitUse quit or exit to leave the interactive shell.
-
set key=value
-Use this to set value of particular configuration variable. One thing to note here is that if you misspell the variable name, cli will not show an error.
+
+resetResets the configuration to the default values (as of Hive 0.10: see
+HIVE-3202).
-
+set
-This will print a list of configuration variables that are overridden by user or hive.
+
+set <key>=<value>Sets the value of a particular configuration variable (the key).
+
Note: If you misspell the variable name, the CLI will not show an error.
+
+setPrints a list of configuration variables that are overridden by the user or Hive.
+
-
+set -v
-This will print all hadoop and hive configuration variables.
+
+set -vPrints all Hadoop and Hive configuration variables.
+
+add file[s] <filepath> <filepath>*
+add jar[s] <filepath> <filepath>*
+add archive[s] <filepath> <filepath>*Adds one or more files, jars, or archives to the list of resources in the distributed cache.
+
-
add FILE [file] [file]*
-Adds a file to the list of resources
+
+list file[s]
+list jar[s]
+list archive[s]Lists the resources that have already been added to the distributed cache.
-
list FILE
-list all the files added to the distributed cache
+
+list file[s] <filepath>*
+list jar[s] <filepath>*
+list archive[s] <filepath>*Checks whether the given resources are already added to the distributed cache.
-
list FILE [file]*
-Check if given resources are already added to distributed cache
+
+delete file[s] <filepath>*
+delete jar[s] <filepath>*
+delete archive[s] <filepath>*Removes the resource(s) from the distributed cache.
-
! [cmd]
-Executes a shell command from the hive shell
+
+! <command>Executes a shell command from the Hive shell.
-
dfs [dfs cmd]
-Executes a dfs command from the hive shell
+
+dfs <dfs command>Executes a dfs command from the Hive shell.
-
[query]
-Executes a hive query and prints results to standard out
+
+<query string>Executes a Hive query and prints results to standard output.
-
source FILE
-Used to execute a script file inside the CLI.
+
+source file <filepath>Executes a script file inside the CLI.
Sample Usage
hive-log4j.default in the conf/ directory of the Hive installation, which writes out logs to /tmp/<userid>/hive.log and uses the WARN level.hive.root.logger specifies both the logging level INFO and the log destination. Specifying console as the target sends the logs to the standard error (instead of the log file).
-Sample Usage
-
-
+... MAP a.networkid USING 'wc -l' ...
+
Here wc is an executable available on all machines.... MAP a.networkid USING '/home/nfsserv1/hadoopscripts/tt.py' ...
+
Here tt.py may be accessible via an NFS mount point that is configured identically on all the cluster nodes.