Hive_Hive的管理_CLI方式


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;

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM