2016-05-13 31 views
1

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

+0

是的,我用分区表来解决这个问题。 –

+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; 
相关问题