上传数据到hdfs文件系统
创建hdfs文件系统文件夹
hadoop fs -mkdir /user/hive/warehouse/test/
导入本地的文件到hdfs
hadoop fs -put test.txt /user/hive/warehouse/test/
查看刚才创建的test文件夹是否有test.txt数据
hadoop fs -ls /user/hive/warehouse/test/
查看刚才上传的数据
hadoop fs -cat /user/hive/warehouse/test/test.txt
创建hive表
beeline
create table test (name string,age string,sex string) row format delimited fields terminated by ',' stored as textfile;
查看hive数据是否已经加载进去了,没有就再执行一下以下命令
select * from test limit 10;
load data in path '/user/hive/warehouse/test/' into table test;
网友评论