创建一个文本文件1.txt
1,Apollo,25
2,Paul,43
3,Tom,55
4,Marry,29
创建一个表映射
create table t_t2(id int, name string, age int) row format delimited fields terminated by ',';
将文本文件1.txt
上传到/user/hive/warehouse/gosuncn.db/t_t2
目录中
hadoop fs -put 1.txt /user/hive/warehouse/gosuncn.db/t_t2
接下来可以进行
select * from t_t2;
select count(*) from t_t2;
内容来源于网络,如有侵权,请联系作者删除!