赞
踩
将hive表中的数据导出到其他任意目录,例如linux本地磁盘,例如hdfs,例如mysql等等
insert overwrite local directory '/export/servers/exporthive/a' select * from 表名;
insert overwrite local directory '/export/servers/exporthive' row format delimited fields terminated by '分隔符' collection items terminated by '#' select * from 表名;
collection items terminated by ‘#’ 对集合类型使用#来进行分割
insert overwrite directory '/export/servers/exporthive' row format delimited fields terminated by '\t' collection items terminated by '#' select * from score;
注: 对于集合类型我们使用#来进行分割,因为这个表里面没有集合类型,所以加不加这个结果都一样
dfs -get /export/servers/exporthive/000000_0 /export/servers/exporthive/local.txt;
bin/hive -e "select * from myhive.score;" > /export/servers/exporthive/score.txt
export table score to '/export/exporthive/score';
关注我博客 sqoop 专栏 里面有
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。