Hive管理的三种方式
CLI Web 远程服务启动
CLI 命令行方式
- hive
- hive --service cil
退出
- quit;
- exit;
清屏
Ctrl + L
!clear
查看数据仓库中的表
show tables;
查看数据仓库中的内置函数
show function;
常用的CLI命令
查看表名
desc 表名
查看HDFS上的文件
dfs -ls 目录
执行操作系统的命令
! 命令
执行HQL语句
select *** form ***
执行SQl语句
shource SQL文件
vi my.sql
select * from test;
source my.sql //查询*的时候不会转换成mapreduce任务
//查询具体的列的时候才会转换成mr
Hive的静默模式
hive -S
MR执行过程不再输出,只输出查询的结果
hive -S 'show tables';
在命令行下直接查询
hive -e 'show tables';
hive -S -e 'show tables';
Hive web管理模式
hive --service hwi &
低版本的hive会报错没有这个war包
Hive的远程服务
hive --service hiveserver &
//hiveserver
//端口号 10000