赞
踩
Hive客户端工具后续将使用Beeline 替代HiveCLI ,并且后续版本也会废弃掉HiveCLI 客户端工具,Beeline是 Hive 0.11版本引入的新命令行客户端工具,它是基于SQLLine CLI的JDBC客户端。
Beeline支持嵌入模式(embedded mode)和远程模式(remote mode)。在嵌入式模式下,运行嵌入式的Hive(类似Hive CLI),而远程模式可以通过Thrift连接到独立的HiveServer2进程上。从Hive 0.14版本开始,Beeline使用HiveServer2工作时,它也会从HiveServer2输出日志信息到STDERR。
1. beeline 的常用参数
Usage: java org.apache.hive.cli.beeline.BeeLine-u the JDBC URL to connect to-n the username to connect as-p the password to connect as-d the driver class to use-i script file forinitialization-e query that should be executed-f script filethat should be executed-w (or) --password-file the password fileto read password from--hiveconf property=value Use value forgiven property--hivevar name=value hive variable name and value
This is Hive specific settingsin whichvariables
can be set at session level and referencedinHive
commands or queries.--color=[true/false] control whether color is used fordisplay--showHeader=[true/false] show column names inquery results--headerInterval=ROWS; the interval between whichheades are displayed--fastConnect=[true/false] skip building table/column list for tab-completion--autoCommit=[true/false] enable/disable automatic transaction commit--verbose=[true/false] show verbose error messages and debug info
--showWarnings=[true/false] display connection warnings--showNestedErrs=[true/false] display nested errors--numberFormat=[pattern] format numbers using DecimalFormat pattern--force=[true/false] continue running script even after errors--maxWidth=MAXWIDTH the maximum width of the terminal--maxColumnWidth=MAXCOLWIDTH the maximum width to use when displaying columns--silent=[true/false] be moresilent--autosave=[true/false] automatically save preferences--outputformat=[table/vertical/csv2/tsv2/dsv/csv/tsv] format mode forresult display
Note that csv, and tsv are deprecated-use csv2, tsv2 instead--truncateTable=[true/false] truncate table column when it exceeds length--delimiterForDSV=DELIMITER specify the delimiter for delimiter-separated values output format (default: |)--isolation=LEVEL set the transaction isolation level--nullemptystring=[true/false] set to true to get historic behavior of printing null as empty string
--addlocaldriverjar=DRIVERJARNAME Add driver jar file inthe beeline client side--addlocaldrivername=DRIVERNAME Add drvier name needs to be supported inthe beeline client side--help display this message
Beeline version 2.3.4.spark2 by Apache Hive
参数详解
选项
描述
-u
用于JDBC URL连接。用例:beeline -udb_URL
-r
重新连接到最近使用过的URL(如果用户有预先使过的用的,用!connect生成URL,用!save 生成beeline.properties.file)。
用例: beeline -r
Version: 2.1.0 (HIVE-13670)
-n
连接时使用的用户名。用例: beeline -nvalid_user
-p
连接时使用的密码。用例: beeline -p valid_password 可选的密码模式: 从Hive 2.2.0开始参数-p选项是可选的。
用例 : beeline -p [valid_password]
如果
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。