首页 > 其他 > 详细

Hive_Hive的管理_Hive的管理之CLI方式

时间:2017-01-19 14:00:30      阅读:245      评论:0      收藏:0      [点我收藏+]

Hive的启动方式
- CLI
- Web UI
- 远程服务启动方式

 

(1)hive命令行的交互模式,进入hive:

hive;
hive --service cli;
hive -S;(设置Hive静默模式,不打印 map reduce info)

 

(2)不进入hive的交互模式,在操作系统的提示符下进行操作:

$hive -e show tables;
$hive -S -e show tables; (静默模式:不输出调试信)

 

(3)退出hive:

quit;
exit;

 

(4)清屏:

Ctrl+L or !clear;

 

(5)函数:

show functions;

 

(6)查看表结构:

desc tableName;

 

(7)查看HDFS上的文件:

dfs -ls dir;
dfs -ls /user

 

(8)递归查看目录结构:

dfs -lsr /user

 

(9)在hive下执行操作系统的命令:!命令

!pwd
!ls
...

 

(10)在CLI下执行HQL语句:

select * from tableName; (will not change to map reduce, because it just need to read all file context.)
select tname from tableName; (open a map reduce job to execute)

 

(11)在CLI下执行SQL脚本:

vi my.sql;
source dir/my.sql;

 

Hive_Hive的管理_Hive的管理之CLI方式

原文:http://www.cnblogs.com/liupuLearning/p/6306236.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!