歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux編程 >> SHELL編程 >> Hive shell 常用命令

Hive shell 常用命令

日期:2017/3/1 9:45:24   编辑: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;

Hive 的詳細介紹:請點這裡
Hive 的下載地址:請點這裡

Copyright © Linux教程網 All Rights Reserved