如何将目录数据加载到配置单元

时间:2016-05-13 07:08:26

标签: file hive load hdfs

如何将hdfs文件加载到配置单元中。在我的项目中,它需要将hdfs文件加载到配置单元中。我的hdfs文件结构如`/ flume / topic / date / hour / file.hdfs``,问题是如何自动加载目录数据。

1 个答案:

答案 0 :(得分:0)

1) Directory contains three files

     -rw-r--r--   1 hadoop supergroup        125 2017-05-15 17:53/hallfolder/hall.csv
     -rw-r--r--   1 hadoop supergroup        125 2017-05-15 17:53/hallfolder/hall1.csv
     -rw-r--r--   1 hadoop supergroup        125 2017-05-15 17:54/hallfolder/hall2.csv
2) Enable this command

     hive > SET mapred.input.dir.recursive=true;
3) hive>

     hive>load data  inpath '/hallfolder/*' into table alltable;