标签:
vi tb_hive.txt
12 34 56
7 12 13
41 2 31
17 21 3
71 2 31
1 12 34
11 2 34
[root@NameNode-82 hive_w]# hive shell
建表结构
hive> CREATE TABLE tb_hive (a int, b int, c int) ROW FORMAT DELIMITED FIELDS TERMINATED BY ‘\t‘;
导入文件
hive> LOAD DATA LOCAL INPATH ‘/work/wangliqin/hive_w/tb_hive.txt‘ OVERWRITE INTO TABLE tb_hive ;
Copying data from file:/work/wangliqin/hive_w/tb_hive.txt
Copying file: file:/work/wangliqin/hive_w/tb_hive.txt
Loading data to table default.tb_hive
Deleted hdfs://NameNode-82:54310/user/hive/warehouse/tb_hive
OK
Time taken: 0.511 seconds
查看表
hive> show tables;
OK
t_hive
Time taken: 0.142 seconds
删除表
hive> drop table t_hive;
OK
Time taken: 2.356 seconds
[root@NameNode-82 hive_w]#
hadoop fs -cat /user/hive/warehouse/tb_hive/tb_hive.txt
16 2 3
61 12 13
41 2 31
17 21 3
71 2 31
1 12 34
11 2 34
版权声明:本文为博主原创文章,未经博主允许不得转载。
标签:
原文地址:http://blog.csdn.net/u011579204/article/details/47087951