Hive Beeline

Beeline是Hive 0.11引入的新的交互式CLI,基于SQLLine,可以作为Hive JDBC Client端访问Hive Server2,启动一个Beeline就是维护一个session。
Hive Server1中我们习惯了用Hive CLI,方式如下,

[trafodion@n12 udr]$ hive
OpenJDK 64-Bit Server VM warning: ignoring option MaxPermSize=512M; support was removed in 8.0
OpenJDK 64-Bit Server VM warning: Using incremental CMS is deprecated and will likely be removed in a future release
17/03/10 15:20:22 WARN mapreduce.TableMapReduceUtil: The hbase-prefix-tree module jar containing PrefixTreeCodec is not present.  Continuing without it.
OpenJDK 64-Bit Server VM warning: ignoring option MaxPermSize=512M; support was removed in 8.0

Logging initialized using configuration in jar:file:/opt/cloudera/parcels/CDH-5.7.2-1.cdh5.7.2.p0.18/jars/hive-common-1.1.0-cdh5.7.2.jar!/hive-log4j.properties
WARNING: Hive CLI is deprecated and migration to Beeline is recommended.
hive>

而用Beeline连接Hive则是以下这样,

[trafodion@n12 udr]$ beeline
OpenJDK 64-Bit Server VM warning: ignoring option MaxPermSize=512M; support was removed in 8.0
OpenJDK 64-Bit Server VM warning: Using incremental CMS is deprecated and will likely be removed in a future release
17/03/10 15:14:30 WARN mapreduce.TableMapReduceUtil: The hbase-prefix-tree module jar containing PrefixTreeCodec is not present.  Continuing without it.
OpenJDK 64-Bit Server VM warning: ignoring option MaxPermSize=512M; support was removed in 8.0
Beeline version 1.1.0-cdh5.7.2 by Apache Hive
beeline> !connect jdbc:hive2://n11:10000/default
scan complete in 3ms
Connecting to jdbc:hive2://n11:10000/default
Enter username for jdbc:hive2://n11:10000/default: hive
Enter password for jdbc:hive2://n11:10000/default: ****
Connected to: Apache Hive (version 1.1.0-cdh5.7.2)
Driver: Hive JDBC (version 1.1.0-cdh5.7.2)
Transaction isolation: TRANSACTION_REPEATABLE_READ
0: jdbc:hive2://n11:10000/default>

上面的jdbc:hive2://n11:10000/default,即是Hive Connection URL,n11为Hive Server2节点的IP,10000为Hive Server2默认的端口号,default为Hive默认的数据库名称。
关于Beeline命令行的使用,请参考:https://cwiki.apache.org//confluence/display/Hive/HiveServer2+Clients#HiveServer2Clients-BeelineExample

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

数据源的港湾

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值