Skip to content

Commit

Permalink
Fix loading Hadoop configuration file with relative Xinclude files
Browse files Browse the repository at this point in the history
  • Loading branch information
crossfire authored and ebyhr committed Jun 27, 2020
1 parent 6e43e24 commit 8444bd0
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,9 @@ public static Configuration readConfiguration(List<File> resourcePaths)
checkArgument(resourcePath.exists(), "File does not exist: %s", resourcePath);

Configuration resourceProperties = new Configuration(false);
resourceProperties.addResource(new Path(resourcePath.toURI()));
// We need to call `getPath` instead of `toURI` because Hadoop library can not handle a configuration file with relative Xinclude files in case of passing URI.
// In details, see https://issues.apache.org/jira/browse/HADOOP-17088.
resourceProperties.addResource(new Path(resourcePath.getPath()));
copy(resourceProperties, result);
}

Expand Down

0 comments on commit 8444bd0

Please sign in to comment.