We can create a Hive Table on HDFS path which consist of data in sub directories. Like -
Table A
|--Dir1
| |--datafile
|--Dir2
| |--datafile
|--Dir3
|--datafile
When we read this Hive table using Spark it gives error that "respective path is a directory not a file".
Solution- Data can be read recursively by setting following property -
Table A
|--Dir1
| |--datafile
|--Dir2
| |--datafile
|--Dir3
|--datafile
When we read this Hive table using Spark it gives error that "respective path is a directory not a file".
Solution- Data can be read recursively by setting following property -
set
mapreduce.input.fileinputformat.input.dir.recursive=true;
Comments
Post a Comment