Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: document beeline command options (HIVE-6173, -5765, -4268)

...

No Format
% bin/beeline
Hive version 0.11.0-SNAPSHOT by Apache
beeline> !connect jdbc:hive2://localhost:10000 scott tiger org.apache.hive.jdbc.HiveDriver
!connect jdbc:hive2://localhost:10000 scott tiger org.apache.hive.jdbc.HiveDriver
Connecting to jdbc:hive2://localhost:10000
Connected to: Hive (version 0.10.0)
Driver: Hive (version 0.10.0-SNAPSHOT)
Transaction isolation: TRANSACTION_REPEATABLE_READ
0: jdbc:hive2://localhost:10000> show tables;
show tables;
+-------------------+
|     tab_name      |
+-------------------+
| primitives        |
| src               |
| src1              |
| src_json          |
| src_sequencefile  |
| src_thrift        |
| srcbucket         |
| srcbucket2        |
| srcpart           |
+-------------------+
9 rows selected (1.079 seconds)

Beeline Command Options

The Beeline CLI supports these command line options:

Option

Usage

Description

-u <database URL>

beeline -u db_URL 

The JDBC URL to connect to.

-n <username>

beeline -n user1

The username to connect as.

-p <password>

beeline -p user1_password

The password to connect as.

-d <driver class>

beeline -d driver_class

The driver class to use.

-e <query>

beeline -e 'query_string'

Query that should be executed.

Version: 0.13.0 (HIVE-5765)

-f <file>beeline -f filepath

Script file that should be executed.

Version: 0.12.0 (HIVE-4268)

--hiveconf property=valuebeeline --hiveconf prop1=value1

Use value for the given property.

Version: 0.13.0 (HIVE-6173)

--hivevar name=valuebeeline --hivevar var1=value1 Hive variable name and value. This is a Hive-specific setting in
which variables can be set at the session level and referenced
in Hive commands or queries.
--color=[true/false]beeline --color=true Control whether color is used for display. Default is false.
--showHeader=[true/false]beeline --showHeader=false Show column names in query results (true) or not (false).
--headerInterval=ROWSbeeline --headerInterval=50 The interval for redisplaying column headers, in number of rows,
when --outputformat is table. Default value is 100.
--fastConnect=[true/false]beeline --fastConnect=false When connecting, skip building a list of all tables and columns for
tab-completion of HiveQL statements (true) or build the list (false).
--autoCommit=[true/false]beeline --autoCommit=true Enable/disable automatic transaction commit. Default is true.
--verbose=[true/false]beeline --verbose=false Show verbose error messages and debug information (true)
or do not show (false).
--showWarnings=[true/false]beeline --showWarnings=true Display connection warnings.
--showNestedErrs=[true/false]beeline --showNestedErrs=true Display nested errors.
--numberFormat=[pattern]beeline --numberFormat=patternFormat numbers using DecimalFormat pattern.
--force=[true/false]beeline--force=false Continue running script even after errors (true)
or do not continue (false).
--maxWidth=MAXWIDTHbeeline --maxWidth=150 The maximum width of the terminal, in characters.
--maxColumnWidth=MAXCOLWIDTHbeeline --maxColumnWidth=40 The maximum width to use when displaying columns,
in characters.
--silent=[true/false]beeline --silent=false Be more silent (true) or not (false).
--autosave=[true/false]beeline --autosave=true Automatically save preferences (true) or do not autosave (false).
Default is false.
--outputformat=[table/vertical/csv/tsv]beeline --outputformat=table Format mode for result display.
--isolation=LEVELbeeline --isolation=xxxxxxxxxxxxx Set the transaction isolation level.
--nullemptystring=[true/false]beeline --nullemptystring=false Get historic behavior of printing null as empty string (true)
or not (false).

--help

beeline --help

Display a usage message.

JDBC

HiveServer2 has a new JDBC driver. It supports both embedded and remote access to HiveServer2.

...