beeline 参数
Beeline工作模式有两种,即本地嵌入模式和远程模式。嵌入模式情况下,它返回一个嵌入式的Hive(类似于Hive CLI)。而远程模式则是通过Thrift协议与某个单独的HiveServer2进程进行连接通信。
下面给一个简单的登录Beeline的使用实例:
- % bin/beeline
- Hive version 0.11.0-SNAPSHOT by Apache
- beeline> !connect jdbc:hive2://localhost:10000/default
- !connect jdbc:hive2://localhost:10000/default
- Connecting to jdbc:hive2://localhost:10000/default
- Connected to: Hive (version 0.10.0)
- Driver: Hive (version 0.10.0-SNAPSHOT)
- Transaction isolation: TRANSACTION_REPEATABLE_READ
- 0: jdbc:hive2://localhost:10000> show tables;
- show tables;
- +-------------------+
- | tab_name |
- +-------------------+
- | primitives |
- | src |
- | src1 |
- | src_json |
- | src_sequencefile |
- | src_thrift |
- | srcbucket |
- | srcbucket2 |
- | srcpart |
- +-------------------+
- 9 rows selected (1.079 seconds)
我们项目在使用的过程中,因为整合了Hamza的权限控制, 使用的时候需要传入用户名和密码,(常用的方式有单次查询-e,也可以把命令写到一个文件中-f),远程连接到HiveServer2:
beeline -u "jdbc:hive2://hadoop1:10000/hamza_group_1" --hivevar hamza.usr="hamza_group" --hivevar hamza.passwd="hMyLXJ6uddQSy1WU" --color=true;
退出beeline命令行则是!quit, 很多命令都是前面需要加一个感叹号, 但对于登录了后的DDL,DML,则直接运行SQL语句即可,语句后带上一个分号,然后回车执行。
- The Beeline CLI 支持以下命令行参数:
- Option
- Description
- --autoCommit=[true/false]
- Enable/disable automatic transaction commit. Default is false.
- Usage: beeline --autoCommit=true
- --autosave=[true/false]
- Automatically save preferences (true) or do not 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 Output formats. See HIVE-9770)
- --delimiterForDSV= DELIMITER
- The delimiter for delimiter-separated values output format. Default is '|' character.
- Version: 0.14.0 (HIVE-7390)
- --fastConnect=[true/false]
- When connecting, skip building a list of all 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 column headers, in number of rows, when outputformat is table.
- Default is 100.
- Usage: beeline --headerInterval=50
- (Not supported for Separated-Value Output formats. See HIVE-9770)
- --help
- Display a usage message.
- Usage: beeline --help
- --hiveconf property=value
- Use value for the given configuration property. Properties that are listed in hive.conf.restricted.list cannot be reset 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 a Hive-specific setting in which variables can be set
- at the session level and referenced in Hive commands or queries.
- Usage: beeline --hivevar var1=value1
- --incremental=[true/false]
- Print output incrementally.
- --isolation=LEVEL
- Set the transaction isolation level to TRANSACTION_READ_COMMITTED
- or TRANSACTION_SERIALIZABLE.
- See the "Field Detail" section in the 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 before truncating data, in characters, when outputformat is table.
- Default is to query the terminal for current width, then fall back to 80.
- Usage: beeline --maxWidth=150
- --nullemptystring=[true/false]
- Use historic behavior of printing null as empty string (true) or use current behavior of printing
- null as NULL (false). Default is false.
- Usage: beeline --nullemptystring=false
- Version: 0.13.0 (HIVE-4485)
- --numberFormat=[pattern]
- Format numbers using a DecimalFormat pattern.
- Usage: beeline --numberFormat="#,###,##0.00"
- --outputformat=[table/vertical/csv/tsv/dsv/csv2/tsv2]
- Format mode for result display. Default is table. See Separated-Value Output Formats below for description of recommended sv 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 is false.
- Usage: beeline --showNestedErrs=true
- --showWarnings=[true/false]
- Display warnings that are reported on the connection after issuing any HiveQL commands.
- Default is false.
- Usage: beeline --showWarnings=true
- --silent=[true/false]
- Reduce the amount of informational messages displayed (true) or not (false). It also stops displaying the log messages for the query from HiveServer2 (Hive 0.14 and later). Default is false.
- Usage: beeline --silent=true
- --truncateTable=[true/false]
- If true, truncates table column in the console when it exceeds console length.
- Version: 0.14.0 (HIVE-6928)
- --verbose=[true/false]
- Show verbose error messages and debug information (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 or single quotes enclose the query string. This option can be specified multiple times.
- Usage: beeline -e "query_string"
- Icon
- Only a single command per -e option is supported. You can't provide multiple semicolon separated commands. Use the -e option 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, query compilation 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
beeline 参数相关推荐
- Kyuubi 实践 | Apache Kyuubi on Spark 在CDH上的深度实践
Kyuubi 简介 Kyuubi 是网易有数的大数据开源项目,于2021年6月全票通过进入世界顶级开源基金会 Apache Software Foundation 孵化器. Kyuubi 的命名源自中 ...
- hive hive beeline常用参数
Hive 1参数如下: usage: hive -d,--define <key=value> Variable substitution to apply to Hive command ...
- Beeline – 命令行参数详解
Beeline Shell 在嵌入式模式和远程模式下均可工作.在嵌入式模式下,它运行嵌入式 Hive(类似于Hive CLI),而远程模式用于通过 Thrift 连接到单独的 HiveServer2 ...
- beeline 将查询的数据导出来_滴滴大数据安全权限实践
导读: 在滴滴,数据是非常重要的资产,基于数据的数仓建设,数据分析.数据挖掘.数据科学等构建了滴滴的数据体系,支撑着滴滴的业务快速发展.在这个背景下,如何保障用户获取数据的易用性的同时可以更加安全,是 ...
- beeline执行sql语句_由“Beeline连接HiveServer2后如何使用指定的队列(Yarn)运行Hive SQL语句”引发的一系列思考...
背景 我们使用的HiveServer2的版本为0.13.1-cdh5.3.2,目前的任务使用Hive SQL构建,分为两种类型:手动任务(临时分析需求).调度任务(常规分析需求),两者均通过我们的We ...
- BigData之Hive beeline:beeline的简介、使用方法之详细攻略
BigData之Hive beeline:beeline的简介.使用方法之详细攻略 目录 beeline的简介 beeline的使用方法 1.命令行参数解释 2.beeline的输出格式 2.1.ta ...
- HIVE的安装配置、mysql的安装、hive创建表、创建分区、修改表等内容、hive beeline使用、HIVE的四种数据导入方式、使用Java代码执行hive的sql命令
1.上传tar包 这里我上传的是apache-hive-1.2.1-bin.tar.gz 2.解压 mkdir -p /home/tuzq/software/hive/ tar -zxvf apach ...
- 【原创】大叔问题定位分享(33)beeline连接presto报错
hive2.3.4 presto0.215 使用hive2.3.4的beeline连接presto报错 $ beeline -d com.facebook.presto.jdbc.PrestoDriv ...
- beeline安装_hive使用beeline配置远程连接
hive以hadoop集群为基础,提供hdfs的SQL支持: hive一般可以以mysql为元数据存储,默认Derby:hadoop,hive安装自行百度吧: 介绍hive的远程访问: 未配置之前使用 ...
最新文章
- Spring Boot与Docker||Docker基本使用、Docker环境||安装Docker
- C++面试常见问题整理汇总(面试者必看哦!)
- 2015 总结 2016 展望
- python api数据接口_python写数据api接口
- 飞鸽传书有多少用户?
- R统计绘图 - 热图美化
- java+txt+词语+次数_Java练习2--读取txt文件统计考勤次数并写入一个txt文件中
- mysql 计算时区差_在MySQL中计算时区的偏移量
- phpcms 调用多级栏目和多级栏目下的文章列表
- 地球会随着人口增加而变重吗
- 《Android高级进阶》— Android 书籍
- Reporting Service RDLC 数据换行解决方案
- javaEE常用开源框架的认识及概述,带你深入探索Java开发世界
- 【信号与系统】信号频谱和测量之汉明窗
- 银行卡四元素/四要素校验API,银行卡实名认证接口文档
- Hive实现数据文件导入与分析
- 非主流闪图头像教程:扩散粒子效果
- .NET 4.0 Interop新特性ICustomQueryInterface
- NEW a Girl Friend
- word恢复忘记保存的文档