Hive shell 命令

ii_chengzi發表於2019-09-19

 連線 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; 

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/31543790/viewspace-2657592/,如需轉載,請註明出處,否則將追究法律責任。

相關文章