Add constructor to HoodieROTablePathFilter (#1413)
Allows HoodieROTablePathFilter to accept a configuration for initializing the filesystem. This fixes a bug with Presto's use of this pathfilter. Co-authored-by: Brandon Scheller <bschelle@amazon.com>
This commit is contained in:
@@ -63,12 +63,21 @@ public class HoodieROTablePathFilter implements PathFilter, Serializable {
|
|||||||
*/
|
*/
|
||||||
private HashSet<String> nonHoodiePathCache;
|
private HashSet<String> nonHoodiePathCache;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Hadoop configurations for the FileSystem.
|
||||||
|
*/
|
||||||
|
private Configuration conf;
|
||||||
|
|
||||||
private transient FileSystem fs;
|
private transient FileSystem fs;
|
||||||
|
|
||||||
public HoodieROTablePathFilter() {
|
public HoodieROTablePathFilter() {
|
||||||
hoodiePathCache = new HashMap<>();
|
this(new Configuration());
|
||||||
nonHoodiePathCache = new HashSet<>();
|
}
|
||||||
|
|
||||||
|
public HoodieROTablePathFilter(Configuration conf) {
|
||||||
|
this.hoodiePathCache = new HashMap<>();
|
||||||
|
this.nonHoodiePathCache = new HashSet<>();
|
||||||
|
this.conf = conf;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -93,7 +102,7 @@ public class HoodieROTablePathFilter implements PathFilter, Serializable {
|
|||||||
Path folder = null;
|
Path folder = null;
|
||||||
try {
|
try {
|
||||||
if (fs == null) {
|
if (fs == null) {
|
||||||
fs = path.getFileSystem(new Configuration());
|
fs = path.getFileSystem(conf);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Assumes path is a file
|
// Assumes path is a file
|
||||||
|
|||||||
Reference in New Issue
Block a user