Beeline command line
!<SQLLine_command> |
Executes an SQLLine command |
!delimiter |
Sets the delimiter for queries written in Beeline.
Multi-character delimiters are allowed, but quotation marks, slashes, and dashes ( Usage: Version: 3.0.0 |
fetchsize |
The JDBC standard allows you to specify the number of rows fetched with each database round-trip for a query, and this number is referred to as the fetch size. Setting the fetch size in Beeline overrides the JDBC driver’s default fetch size and affects subsequent statements executed in the current session. Setting the value to Setting the value to Any other negative value will throw an exception. Usage: Version: 4.0.0 |
Beeline Hive commands
Hive-specific commands (same as Hive CLI commands) can run from Beeline, when the Hive JDBC driver is used.
Use ;
(semicolon) to terminate commands. Comments in scripts can be specified using the --
prefix.
reset |
Resets the configuration to the default values |
reset <key> |
Resets the value of a particular configuration variable (key) to the default value If you misspell a key name, Beeline does not show an error. |
set <key>=<value> |
Sets the value of a particular configuration variable (key) If you misspell a variable name, Beeline does 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 |
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. For more information, see Hive Resources page of the Apache Hive documentation |
add FILE[S] <ivyurl> <ivyurl>\* add JAR[S] <ivyurl> <ivyurl>\* add ARCHIVE[S] <ivyurl> <ivyurl>\* |
As of Hive 1.2.0, adds one or more files, JARs, or archives to the list of resources in the distributed cache using an Ivy URL of the form ivy://group:module:version?query_string. For more information, see Hive Resources page of the Apache Hive documentation |
list FILE[S] list JAR[S] list ARCHIVE[S] |
Lists the resources already added to the distributed cache. For more information, see Hive Resources page of the Apache Hive documentation |
list FILE[S] <filepath>\* list JAR[S] <filepath>\* list ARCHIVE[S] <filepath>\* |
Checks whether the given resources are already added to the distributed cache or not. For more information, see Hive Resources page of the Apache Hive documentation |
delete FILE[S] <filepath>\* delete JAR[S] <filepath>\* delete ARCHIVE[S] <filepath>\* |
Removes the resource(s) from the distributed cache |
delete FILE[S] <ivyurl> <ivyurl>\* delete JAR[S] <ivyurl> <ivyurl>\* delete ARCHIVE[S] <ivyurl> <ivyurl>\* |
As of Hive 1.2.0, removes the resource(s) which were added using the <ivyurl> from the distributed cache. See Hive Resources page of the Apache Hive documentation for more information |
reload |
As of Hive 0.14.0, makes HiveServer2 aware of any JAR changes in the path specified by the configuration parameter hive.reloadable.aux.jars.path (without having to restart HiveServer2). The changes can be adding, removing, or updating JAR files |
dfs <dfs command> |
Executes a |
<query string> |
Executes a Hive query and prints results to standard output |
Beeline command options
The Beeline CLI supports these command line options:
Option | Description | Usage example |
---|---|---|
-u <database URL> |
The JDBC URL to connect to. Special characters in parameter values should be encoded with URL encoding if needed |
|
-r |
Reconnects to the last used URL (if you have previously used Version: 2.1.0 |
|
-n <username> |
The username to be used for connection |
|
-p <password> |
The password to be used for connection. Optional password mode: Starting from Hive 2.2.0, the argument for If the password is not provided after |
|
-d <driver class> |
The driver class to use |
|
-e <query> |
Specifies the query to be executed. Double or single quotes enclose the query string. This option can be specified multiple times |
|
-f <file> |
Specifies the path to a script file to be executed. Version: 0.12.0 If the script contains tabs, query compilation fails in version 0.12.0. This bug is fixed in version 0.13.0 |
|
-i <file> --init <files> |
Sets the init file(s) for initialization. Version: 0.14.0: single file definition introduced. Version: 2.1.0: multiple files can be specified |
|
-w <path/to/password_file> --password-file <path/to/password file> |
Specifies the password file to read password from. Version: 1.2.0 |
|
-a <auth type> --authType <auth_type> |
Sets the authentication type passed to the JDBC as an Version: 0.13.0 |
|
--property-file <file> |
Specifies the file to read configuration properties from. Version: 2.2.0 |
|
--hiveconf property=value |
Sets a value for the given configuration property.
Properties that are listed in |
|
--hivevar name=value |
Sets a 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] |
Controls whether color is used for display. Default is |
|
--showHeader=[true/false] |
Shows column names in the query results ( |
|
--headerInterval=ROWS |
The interval for re-displaying column headers, in number of rows, when |
|
--fastConnect=[true/false] |
Controls if the building of a list of all tables and columns for tab-completion of HiveQL statements is skipped ( |
|
--autoCommit=[true/false] |
Enables/disables automatic transaction commit.
Default is |
|
--verbose=[true/false] |
Shows verbose error messages and debug information ( |
|
--showWarnings=[true/false] |
Displays warnings that are reported on the connection after issuing any HiveQL commands.
Default is |
|
--showDbInPrompt=[true/false] |
Displays the current database name in prompt.
Default is Version: 2.2.0 |
|
--showNestedErrs=[true/false] |
Displays nested errors.
Default is |
|
--numberFormat=[pattern] |
Formats numbers using the DecimalFormat pattern |
|
--force=[true/false] |
Continues to run the script even after errors ( |
|
--maxWidth=MAXWIDTH |
Shows the maximum width to display before truncating data, in characters, when |
|
--maxColumnWidth=MAXCOLWIDTH |
Shows the maximum column width, in characters, when |
|
--silent=[true/false] |
Reduces the amount of informational messages displayed ( |
|
--autosave=[true/false] |
Automatically saves preferences ( |
|
--outputformat=[table/vertical/csv/tsv/dsv/csv2/tsv2] |
Sets the format mode for the result display. Default is table. See Separated-value output formats for description of recommended options. Version 0.14.0: added dsv/csv2/tsv2 |
|
--truncateTable=[true/false] |
If set to Version: 0.14.0 |
|
--delimiterForDSV=DELIMITER |
Sets the delimiter for delimiter-separated values output format.
Default is Version: 0.14.0 |
|
--isolation=LEVEL |
Sets the transaction isolation level to |
|
--nullemptystring=[true/false] |
Sets for use the historic behavior of printing null as empty string ( Version: 0.13.0 |
|
--incremental=[true/false] |
Defaults to |
|
--incrementalBufferRows=NUMROWS |
Sets the number of rows to buffer when printing rows on stdout, defaults to 1000; only applicable if Version: 2.3.0 |
|
--maxHistoryRows=NUMROWS |
Sets the maximum number of rows to store Beeline history. Version: 2.3.0 |
|
--delimiter=; |
Sets the delimiter for queries written in Beeline.
Multi-char delimiters are allowed, but quotation marks, slashes, and Version: 3.0.0 |
|
--convertBinaryArrayToString=[true/false] |
Permits to display binary column data as a string using the platform’s default character set. Version: 3.0.0: The default behavior ( The default behavior ( |
|
--help |
Displays usage tips |
|