Beeline工作模式有两种,即本地嵌入模式和远程模式。嵌入模式情况下,它返回一个嵌入式的Hive(类似于Hive CLI)。而远程模式则是通过Thrift协议与某个单独的HiveServer2进程进行连接通信
Description
Enable/disable automatic transactioncommit. Default is false.
Usage: beeline --autoCommit=true
Automatically save preferences (true) or donot autosave (false). Default is false.
Usage: beeline --autosave=true
Control whether color is used for display.Default is false.
Usage: beeline --color=true
(Not supported for Separated-Value Outputformats. See HIVE-9770)
The delimiter for delimiter-separatedvalues output format. Default is '|' character.
Version: 0.14.0 (HIVE-7390)
When connecting, skip building a list ofall tables and columns for tab-completion of
HiveQL statements (true) or build the list(false). Default is true.
Usage: beeline --fastConnect=false
Continue running script even after errors(true) or do not continue (false). Default is false.
Usage: beeline--force=true
The interval for redisplaying columnheaders, in number of rows, when outputformat is table.
Default is 100.
Usage: beeline --headerInterval=50
(Not supported for Separated-Value Outputformats. See HIVE-9770)
Display a usage message.
Usage: beeline --help
--hiveconf property=value
Use value for the given configurationproperty. Properties that are listed in hive.conf.restricted.list cannot bereset with hiveconf (see Restricted List and Whitelist).
Usage: beeline --hiveconf prop1=value1
Version: 0.13.0 (HIVE-6173)
Hive variable name and value. This is aHive-specific setting in which variables can be set
at the session level and referenced in Hivecommands or queries.
Usage: beeline --hivevar var1=value1
Print output incrementally.
Set the transaction isolation level toTRANSACTION_READ_COMMITTED
or TRANSACTION_SERIALIZABLE.
See the "Field Detail" section inthe Java Connection documentation.
Usage: beeline--isolation=TRANSACTION_SERIALIZABLE
The maximum column width, in characters,when outputformat is table. Default is 15.
Usage: beeline --maxColumnWidth=25
The maximum width to display beforetruncating data, in characters, when outputformat is table.
Default is to query the terminal forcurrent width, then fall back to 80.
Usage: beeline --maxWidth=150
Use historic behavior of printing null asempty string (true) or use current behavior of printing
null as NULL (false). Default isfalse.
Usage: beeline --nullemptystring=false
Version: 0.13.0 (HIVE-4485)
Format numbers using a DecimalFormatpattern.
Usage: beeline--numberFormat="#,###,##0.00"
Format mode for result display. Default istable. See Separated-Value Output Formats below for description of recommendedsv options.
Usage: beeline --outputformat=tsv
Version: dsv/csv2/tsv2 added in 0.14.0 (HIVE-8615)
Show column names in query results (true)or not (false). Default is true.
Usage: beeline --showHeader=false
Display nested errors. Default isfalse.
Usage: beeline --showNestedErrs=true
Display warnings that are reported on theconnection after issuing any HiveQL commands.
Default is false.
Usage: beeline --showWarnings=true
Reduce the amount of informational messagesdisplayed (true) or not (false). It also stops displaying the log messages forthe query from HiveServer2 (Hive 0.14 and later). Default is false.
Usage: beeline --silent=true
If true, truncates table column in theconsole when it exceeds console length.
Version: 0.14.0 (HIVE-6928)
Show verbose error messages and debuginformation (true) or do not show (false).
Default is false.
Usage: beeline --verbose=true
The driver class to use.
Usage: beeline -d driver_class
Query that should be executed. Double orsingle quotes enclose the query string. This option can be specified multipletimes.
Usage: beeline -e"query_string"
Icon
Only a single command per -e option issupported. You can't provide multiple semicolon separated commands. Use the -eoption multiple times if you want to achieve this.
Bug fix (null pointer exception): 0.13.0(HIVE-5765)
Bug to be fixed (running -e in background):workaround available (HIVE-6758)
Bug fix (--headerInterval not honored):0.14.0 (HIVE-7647)
Script file that should be executed.
Usage: beeline -f filepath
Version: 0.12.0 (HIVE-4268)
Note: If the script contains tabs, querycompilation fails in version 0.12.0. This bug is fixed in version 0.13.0(HIVE-6359).
Bug to be fixed (running -f in background):workaround available (HIVE-6758)
The username to connect as.
Usage: beeline -n valid_user
The password to connect as.
Usage: beeline -p valid_password
The JDBC URL to connect to.
Usage: beeline -u db_URL