Hive Beeline 命令行参数

[hadoop@hive ~]$ beeline --help【中文版】

  1. The Beeline CLI 支持以下命令行参数:    
  2. Option    
  3. Description    
  4. --autoCommit=[true/false] ---进入一个自动提交模式:beeline --autoCommit=true    
  5. --autosave=[true/false]   ---进入一个自动保存模式:beeline --autosave=true    
  6. --color=[true/false]    ---显示用到的颜色:beeline --color=true    
  7. --delimiterForDSV= DELIMITER ---分隔值输出格式的分隔符。默认是“|”字符。    
  8. --fastConnect=[true/false]  ---在连接时,跳过组建表等对象:beeline --fastConnect=false    
  9. --force=[true/false]    ---是否强制运行脚本:beeline--force=true    
  10. --headerInterval=ROWS   ---输出的表间隔格式,默认是100: beeline --headerInterval=50    
  11. --help ---帮助  beeline --help    
  12. --hiveconf property=value  ---设置属性值,以防被hive.conf.restricted.list重置:beeline --hiveconf prop1=value1     
  13. --hivevar name=value   ---设置变量名:beeline --hivevar var1=value1    
  14. --incremental=[true/false]  ---输出增量  
  15. --isolation=LEVEL  ---设置事务隔离级别:beeline --isolation=TRANSACTION_SERIALIZABLE    
  16. --maxColumnWidth=MAXCOLWIDTH ---设置字符串列的最大宽度:beeline --maxColumnWidth=25    
  17. --maxWidth=MAXWIDTH ---设置截断数据的最大宽度:beeline --maxWidth=150    
  18. --nullemptystring=[true/false]  ---打印空字符串:beeline --nullemptystring=false    
  19. --numberFormat=[pattern]     ---数字使用DecimalFormat:beeline --numberFormat="#,###,##0.00"    
  20. --outputformat=[table/vertical/csv/tsv/dsv/csv2/tsv2] ---输出格式:beeline --outputformat=tsv     
  21. --showHeader=[true/false]   ---显示查询结果的列名:beeline --showHeader=false    
  22. --showNestedErrs=[true/false] ---显示嵌套错误:beeline --showNestedErrs=true    
  23. --showWarnings=[true/false] ---显示警告:beeline --showWarnings=true    
  24. --silent=[true/false]  ---减少显示的信息量:beeline --silent=true    
  25. --truncateTable=[true/false] ---是否在客户端截断表的列       
  26. --verbose=[true/false]  ---显示详细错误信息和调试信息:beeline --verbose=true    
  27. -d <driver class>  ---使用一个驱动类:beeline -d driver_class    
  28. -e <query>  ---使用一个查询语句:beeline -e "query_string"    
  29. -f <file>  ---加载一个文件:beeline -f filepath  多个文件用-e file1 -e file2  
  30. -n <username>  ---加载一个用户名:beeline -n valid_user    
  31. -p <password>  ---加载一个密码:beeline -p valid_password    
  32. -u <database URL> ---加载一个JDBC连接字符串:beeline -u db_URL   </span>  

[hadoop@hive ~]$ beeline --help【英文版】

Usage: java org.apache.hive.cli.beeline.BeeLine
-u <database url> the JDBC URL to connect to
-r reconnect to last saved connect url (in conjunction with !save)
-n <username> the username to connect as
-p <password> the password to connect as
-d <driver class> the driver class to use
-i <init file> script file for initialization
-e <query> query that should be executed
-f <exec file> script file that should be executed
-w (or) --password-file <password file> the password file to read password from
--hiveconf property=value Use value for given property
--hivevar name=value hive variable name and value
This is Hive specific settings in which variables
can be set at session level and referenced in Hive
commands or queries.
--property-file=<property-file> the file to read connection properties (url, driver, user, password) from
--color=[true/false] control whether color is used for display
--showHeader=[true/false] show column names in query results
--headerInterval=ROWS; the interval between which heades 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
--showDbInPrompt=[true/false] display the current database name in the prompt
--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 more silent
--autosave=[true/false] automatically save preferences
--outputformat=[table/vertical/csv2/tsv2/dsv/csv/tsv] format mode for result display
Note that csv, and tsv are deprecated - use csv2, tsv2 instead
--incremental=[true/false] Defaults to false. When set to false, the entire result set
is fetched and buffered before being displayed, yielding optimal
display column sizing. When set to true, result rows are displayed
immediately as they are fetched, yielding lower latency and
memory usage at the price of extra display column padding.
Setting --incremental=true is recommended if you encounter an OutOfMemory
on the client side (due to the fetched result set size being large).
Only applicable if --outputformat=table.
--incrementalBufferRows=NUMROWS the number of rows to buffer when printing rows on stdout,
defaults to 1000; only applicable if --incremental=true
and --outputformat=table
--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
--maxHistoryRows=MAXHISTORYROWS The maximum number of rows to store beeline history.
--help display this message

Example

1. Connect using simple authentication to HiveServer2 on localhost:10000
$ beeline -u jdbc:hive2://localhost:10000 username password

2. Connect using simple authentication to HiveServer2 on hs.local:10000 using -n for username and -p for password
$ beeline -n username -p password -u jdbc:hive2://hs2.local:10012

3. Connect using Kerberos authentication with hive/localhost@mydomain.com as HiveServer2 principal
$ beeline -u "jdbc:hive2://hs2.local:10013/default;principal=hive/localhost@mydomain.com"

4. Connect using SSL connection to HiveServer2 on localhost at 10000
$ beeline "jdbc:hive2://localhost:10000/default;ssl=true;sslTrustStore=/usr/local/truststore;trustStorePassword=mytruststorepassword"

5. Connect using LDAP authentication
$ beeline -u jdbc:hive2://hs2.local:10013/default <ldap-username> <ldap-password>

做自己的太阳,成为别人的光!
原文地址:https://www.cnblogs.com/botaoli/p/12908954.html