hadoop-mapreduce-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jason Lowe (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (MAPREDUCE-7086) FileInputFormat recursive=false fails instead of ignoring the directories.
Date Tue, 24 Apr 2018 15:54:00 GMT

    [ https://issues.apache.org/jira/browse/MAPREDUCE-7086?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16450120#comment-16450120

Jason Lowe commented on MAPREDUCE-7086:

Thanks for updating the patch!

Would it be clearer if "non-recursive" or something similar was in the property name?  Otherwise
it gets confusing when recursive=true and ignore.subdirs=true as well.

Does mapreduce.lib.input.FileInputFormat need to be updated as well?  It looks like that take
a slightly different tactic of allowing directories in non-recursive mode but generating degenerate
splits for them.  ignore.subdirs arguably should make it not generate any splits for directory
entries, even degenerate ones.

I agree with Steve that it would be good to add a unit test to verify the behavior of the
new property.  It would also be nice to cleanup the checkstyle warnings which are akin to
the whitespace warnings.

> FileInputFormat recursive=false fails instead of ignoring the directories.
> --------------------------------------------------------------------------
>                 Key: MAPREDUCE-7086
>                 URL: https://issues.apache.org/jira/browse/MAPREDUCE-7086
>             Project: Hadoop Map/Reduce
>          Issue Type: Bug
>            Reporter: Sergey Shelukhin
>            Assignee: Sergey Shelukhin
>            Priority: Major
>         Attachments: HADOOP-15403.patch, MAPREDUCE-7086.patch
> We are trying to create a split in Hive that will only read files in a directory and
not subdirectories.
> That fails with the below error.
> Given how this error comes about (two pieces of code interact, one explicitly adding
directories to results without failing, and one failing on any directories in results), this
seems like a bug.
> {noformat}
> Caused by: java.io.IOException: Not a file: file:/,...warehouse/simple_to_mm_text/delta_0000001_0000001_0000
> 	at org.apache.hadoop.mapred.FileInputFormat.getSplits(FileInputFormat.java:329) ~[hadoop-mapreduce-client-core-3.1.0.jar:?]
> 	at org.apache.hadoop.hive.ql.io.HiveInputFormat.addSplitsForGroup(HiveInputFormat.java:553)
> 	at org.apache.hadoop.hive.ql.io.HiveInputFormat.getSplits(HiveInputFormat.java:754)
> 	at org.apache.hadoop.hive.ql.exec.tez.HiveSplitGenerator.initialize(HiveSplitGenerator.java:203)
> {noformat}
> This code, when recursion is disabled, adds directories to results 
> {noformat} 
> if (recursive && stat.isDirectory()) {
>               result.dirsNeedingRecursiveCalls.add(stat);
>             } else {
>               result.locatedFileStatuses.add(stat);
>             }
> {noformat} 
> However the getSplits code after that computes the size like this
> {noformat}
> long totalSize = 0;                          
// compute total size
>     for (FileStatus file: files) {                //
check we have valid files
>       if (file.isDirectory()) {
>         throw new IOException("Not a file: "+ file.getPath());
>       }
>       totalSize +=
> {noformat}
> which would always fail combined with the above code.

This message was sent by Atlassian JIRA

To unsubscribe, e-mail: mapreduce-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: mapreduce-issues-help@hadoop.apache.org

View raw message