Hive创建简单的查询操作

x33g5p2x  于2021-03-14 发布在 其他  
字(0.3k)|赞(0)|评价(0)|浏览(325)

创建一个文本文件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;

相关文章

微信公众号

最新文章

更多