Hive学习笔记5@beeline命令

Beeline工作模式有两种,即本地嵌入模式和远程模式。嵌入模式情况下,它返回一个嵌入式Hive(类似于Hive CLI)。而远程模式则是通过Thrift协议与某个单独的HiveServer2进程进行连接通信

Beeline CLI命令参数

Description 

--autoCommit=[true/false]    

Enable/disable automatic transactioncommit. Default is false. 

Usage: beeline --autoCommit=true 

--autosave=[true/false]  

Automatically save preferences (true) or donot autosave (false). Default is false. 

Usage: beeline --autosave=true 

--color=[true/false]     

Control whether color is used for display.Default is false. 

Usage: beeline --color=true 

(Not supported for Separated-Value Outputformats. See HIVE-9770) 

--delimiterForDSV= DELIMITER     

The delimiter for delimiter-separatedvalues output format. Default is '|' character. 

Version: 0.14.0 (HIVE-7390) 

--fastConnect=[true/false]   

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 

--force=[true/false]     

Continue running script even after errors(true) or do not continue (false). Default is false. 

Usage: beeline--force=true 

--headerInterval=ROWS    

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) 

--help 

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) 

--hivevar name=value     

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 

--incremental=[true/false] 

Print output incrementally. 

--isolation=LEVEL    

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 

--maxColumnWidth=MAXCOLWIDTH     

The maximum column width, in characters,when outputformat is table. Default is 15. 

Usage: beeline --maxColumnWidth=25 

--maxWidth=MAXWIDTH  

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 

--nullemptystring=[true/false]   

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) 

--numberFormat=[pattern]     

Format numbers using a DecimalFormatpattern. 

Usage: beeline--numberFormat="#,###,##0.00" 

--outputformat=[table/vertical/csv/tsv/dsv/csv2/tsv2]    

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) 

--showHeader=[true/false]    

Show column names in query results (true)or not (false). Default is true. 

Usage: beeline --showHeader=false 

--showNestedErrs=[true/false]    

Display nested errors. Default isfalse. 

Usage: beeline --showNestedErrs=true 

--showWarnings=[true/false]  

Display warnings that are reported on theconnection after issuing any HiveQL commands.  

Default is false. 

Usage: beeline --showWarnings=true 

--silent=[true/false]    

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 

--truncateTable=[true/false]      

If true, truncates table column in theconsole when it exceeds console length. 

Version: 0.14.0 (HIVE-6928) 

--verbose=[true/false]   

Show verbose error messages and debuginformation (true) or do not show (false).  

Default is false. 

Usage: beeline --verbose=true 

-d  

The driver class to use. 

Usage: beeline -d driver_class 

-e  

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) 

-f   

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) 

-n  

The username to connect as. 

Usage: beeline -n valid_user 

-p  

The password to connect as. 

Usage: beeline -p valid_password 

-u  

The JDBC URL to connect to. 

Usage: beeline -u db_URL  

你可能感兴趣的:(hive)