3.1 HiveServer2.Beeline JDBC使用
2024-09-29 23:39:16
https://cwiki.apache.org/confluence/display/Hive/HiveServer2+Clients
一、HiveServer2、Beeline
1、HiveServer2
HiveServer2是作为hive的一个服务启动的;
#启动,也可以让它在后台启动
[root@hadoop-senior hive-0.13.1]# bin/hiveserver2
2、beeline
#连接hiveserver2
[root@hadoop-senior hive-0.13.1]# bin/beeline
beeline> !connect jdbc:hive2://hadoop-senior.ibeifeng.com:10000 root 123456 org.apache.hive.jdbc.HiveDriver #root 123456 :系统的用户名、密码 #连接后,如下所示,就可以执行命令了,和在hive client一样
beeline> !connect jdbc:hive2://hadoop-senior.ibeifeng.com:10000 root 123456 org.apache.hive.jdbc.HiveDriver
Connecting to jdbc:hive2://hadoop-senior.ibeifeng.com:10000
Connected to: Apache Hive (version 0.13.1)
Driver: Hive JDBC (version 0.13.1)
Transaction isolation: TRANSACTION_REPEATABLE_READ
0: jdbc:hive2://hadoop-senior.ibeifeng.com:10> ##这个里面输出结果的格式化效果稍微好一点
0: jdbc:hive2://hadoop-senior.ibeifeng.com:10> show databases;
+----------------+
| database_name |
+----------------+
| db_hive |
| default |
+----------------+
2 rows selected (0.702 seconds) 0: jdbc:hive2://hadoop-senior.ibeifeng.com:10> use default;
No rows affected (0.027 seconds) 0: jdbc:hive2://hadoop-senior.ibeifeng.com:10> show tables;
+---------------------+
| tab_name |
+---------------------+
| bf_1og_20150913 |
| bf_1og_20150913_sa |
| bf_log |
| bf_log_20150914 |
| dept |
| dept_cats |
| dept_part |
| emp |
| emp_ci |
| emp_ext |
| emp_ext2 |
| emp_partition |
+---------------------+
12 rows selected (0.039 seconds) #第二种连接方式。-u参数
[root@hadoop-senior hive-0.13.1]# bin/beeline -u jdbc:hive2://hadoop-senior.ibeifeng.com:10000/default
scan complete in 3ms
Connecting to jdbc:hive2://hadoop-senior.ibeifeng.com:10000/default
Connected to: Apache Hive (version 0.13.1)
Driver: Hive JDBC (version 0.13.1)
Transaction isolation: TRANSACTION_REPEATABLE_READ
Beeline version 0.13.1 by Apache Hive 0: jdbc:hive2://hadoop-senior.ibeifeng.com:10> show tables;
+---------------------+
| tab_name |
+---------------------+
| bf_1og_20150913 |
| bf_1og_20150913_sa |
| bf_log |
| bf_log_20150914 |
| dept |
| dept_cats |
| dept_part |
| emp |
| emp_ci |
| emp_ext |
| emp_ext2 |
| emp_partition |
+---------------------+
12 rows selected (0.12 seconds)
二、JDBC
HiveServer2 JDBC
将分析的结果存储在hive表(result),前端通过DAo代码,进行数据的查询。
最新文章
- Daily Scrum Meeting ——SecondDay(Beta)12.10
- Provisional, Temporary 和Interim 的区别
- 要后台控制前台的的CSS样式,我们可以加入ASP.NET Literal 控件
- How to install DIG dns tool on windows 7
- 关于 mysql.test 数据库
- 安装robotframework时提示权限受限
- Arm Linux系统调用流程详细解析
- 解决一个maven在eclipse中M2_HOME不能调整的问题
- 怎样写Makefile文件(C语言部分)
- Android MediaScanner 详尽分析
- NPOI 修改已存在的excel文件,设置第一行行高
- 基于Docker的TensorFlow机器学习框架搭建和实例源码解读
- VS Code打开使用IDEA搭建的Spring Boot项目运行提示";snakeyaml was not found on the classpath";错误
- 转: chrome64打开弹出窗flash的办法
- R语言使用RMySQL连接及读写Mysql数据库
- Office Web Apps Server
- spring动态加载(刷新)配置文件 [复制链接]
- 为什么在开发中大部分的时候都在用session而Application基本上都不去使用?
- 【转载】Spring最佳后台框架
- canvas基础API
热门文章
- 2016年第七届蓝桥杯c/c++省赛B组
- hdu5318 The Goddess Of The Moon (矩阵高速幂优化dp)
- [oracle]pl/sql --分页过程demo
- kubernetes调度之pod优先级和资源抢占
- Kristen Grauman
- 后端程序员看前端想死(三)是不是该学点js了
- Hibernate中的Sesson操作
- service oriented architecture 构造分布式计算的应用程序的方法 面向服务的架构 分解技术
- Learning Scrapy 中文版翻译 第二章
- machine learning for hacker记录(4) 智能邮箱(排序学习&;推荐系统)