Hive作为大数据环境下的数据仓库工具,支持基于hadoop以sql的方式执行mapreduce的任务,非常适合对大量的数据进行全量的查询分析。
本文主要讲述下hive载cli中如何导入导出数据:

导入数据
第一种方式,直接从本地文件系统导入数据
我的本机有一个test1.txt文件,这个文件中有三列数据,并且每列都是以'\t'为分隔
[root@localhost conf]# cat /usr/tmp/test1.txt1 a1 b12 a2 b23 a3 b34 a4 b
创建数据表:
>create table test1(a string,b string,c string) >row format delimited >fields terminated by '\t'>stored as textfile;
导入数据:
网友评论

