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 <driver class> 

The driver class to use. 

Usage: beeline -d driver_class 

-e <query> 

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 <file>  

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 <username> 

The username to connect as. 

Usage: beeline -n valid_user 

-p <password> 

The password to connect as. 

Usage: beeline -p valid_password 

-u <database URL> 

The JDBC URL to connect to. 

Usage: beeline -u db_URL  

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值