Hive shell 命令


Hive shell 命令。

  連接 hive shell

  直接輸入 hive

  1、顯示表

  hive> show tables; 

  OK 

  test 

  Time taken: 0.17 seconds, Fetched: 1 row(s)

  2、創建表

  hive> create table test(key string); 

  OK 

  Time taken: 0.265 seconds

  3、創建分區表:

  hive> create table logs(ts bigint,line string) partitioned by (dt String,country String);

  4、加載分區表數據:

  hive> load data local inpath '/home/Hadoop/input/file1' into table logs partition (dt='2014-03-11',country='CN');

  5、展示表中有多少分區:

  hive> show partitions logs; 


免責聲明!

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



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