diff --git ql/src/java/org/apache/hadoop/hive/ql/io/HiveInputFormat.java ql/src/java/org/apache/hadoop/hive/ql/io/HiveInputFormat.java index 2ff3951..5d60376 100755 --- ql/src/java/org/apache/hadoop/hive/ql/io/HiveInputFormat.java +++ ql/src/java/org/apache/hadoop/hive/ql/io/HiveInputFormat.java @@ -513,7 +513,7 @@ protected void pushProjectionsAndFilters(JobConf jobConf, Class inputFormatClass // to be a potential problem here since we are always dealing with the // path to something deeper than the table location.) match = - splitPath.startsWith(key) || splitPathWithNoSchema.startsWith(key); + ismatch(splitPath, key) || ismatch(splitPathWithNoSchema, key); } if (match) { ArrayList list = entry.getValue(); @@ -536,4 +536,14 @@ protected void pushProjectionsAndFilters(JobConf jobConf, Class inputFormatClass } } } + private static boolean ismatch(String splitPath, String key) { + if (splitPath.equals(key)) { + return true; + } + int index = splitPath.indexOf(key); + if (index == -1) { + return false; + } + return splitPath.charAt(index+key.length()) == '/'; + } }