[hadoop@hive ~]$ beeline --help【中文版】
- The Beeline CLI 支持以下命令行參數:
- Option
- Description
- --autoCommit=[true/false] ---進入一個自動提交模式:beeline --autoCommit=true
- --autosave=[true/false] ---進入一個自動保存模式:beeline --autosave=true
- --color=[true/false] ---顯示用到的顏色:beeline --color=true
- --delimiterForDSV= DELIMITER ---分隔值輸出格式的分隔符。默認是“|”字符。
- --fastConnect=[true/false] ---在連接時,跳過組建表等對象:beeline --fastConnect=false
- --force=[true/false] ---是否強制運行腳本:beeline--force=true
- --headerInterval=ROWS ---輸出的表間隔格式,默認是100: beeline --headerInterval=50
- --help ---幫助 beeline --help
- --hiveconf property=value ---設置屬性值,以防被hive.conf.restricted.list重置:beeline --hiveconf prop1=value1
- --hivevar name=value ---設置變量名:beeline --hivevar var1=value1
- --incremental=[true/false] ---輸出增量
- --isolation=LEVEL ---設置事務隔離級別:beeline --isolation=TRANSACTION_SERIALIZABLE
- --maxColumnWidth=MAXCOLWIDTH ---設置字符串列的最大寬度:beeline --maxColumnWidth=25
- --maxWidth=MAXWIDTH ---設置截斷數據的最大寬度:beeline --maxWidth=150
- --nullemptystring=[true/false] ---打印空字符串:beeline --nullemptystring=false
- --numberFormat=[pattern] ---數字使用DecimalFormat:beeline --numberFormat="#,###,##0.00"
- --outputformat=[table/vertical/csv/tsv/dsv/csv2/tsv2] ---輸出格式:beeline --outputformat=tsv
- --showHeader=[true/false] ---顯示查詢結果的列名:beeline --showHeader=false
- --showNestedErrs=[true/false] ---顯示嵌套錯誤:beeline --showNestedErrs=true
- --showWarnings=[true/false] ---顯示警告:beeline --showWarnings=true
- --silent=[true/false] ---減少顯示的信息量:beeline --silent=true
- --truncateTable=[true/false] ---是否在客戶端截斷表的列
- --verbose=[true/false] ---顯示詳細錯誤信息和調試信息:beeline --verbose=true
- -d <driver class> ---使用一個驅動類:beeline -d driver_class
- -e <query> ---使用一個查詢語句:beeline -e "query_string"
- -f <file> ---加載一個文件:beeline -f filepath 多個文件用-e file1 -e file2
- -n <username> ---加載一個用戶名:beeline -n valid_user
- -p <password> ---加載一個密碼:beeline -p valid_password
- -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>