diff --git a/ql/src/java/org/apache/hadoop/hive/ql/ppd/OpProcFactory.java b/ql/src/java/org/apache/hadoop/hive/ql/ppd/OpProcFactory.java index eeffe41..d439ae5 100644 --- a/ql/src/java/org/apache/hadoop/hive/ql/ppd/OpProcFactory.java +++ b/ql/src/java/org/apache/hadoop/hive/ql/ppd/OpProcFactory.java @@ -709,7 +709,8 @@ hiveConf); if (condn == null) { // we pushed the whole thing down - return null; + removeCandidateFilters(owi); + return null; } } } @@ -733,26 +734,32 @@ OpParseContext ctx = new OpParseContext(inputRR); owi.put(output, ctx); - if (HiveConf.getBoolVar(owi.getParseContext().getConf(), - HiveConf.ConfVars.HIVEPPDREMOVEDUPLICATEFILTERS)) { - // remove the candidate filter ops - for (FilterOperator fop : owi.getCandidateFilterOps()) { - List> children = fop.getChildOperators(); - List> parents = fop.getParentOperators(); - for (Operator parent : parents) { - parent.getChildOperators().addAll(children); - parent.removeChild(fop); - } - for (Operator child : children) { - child.getParentOperators().addAll(parents); - child.removeParent(fop); - } - } - owi.getCandidateFilterOps().clear(); - } + removeCandidateFilters(owi); + return output; } + private static void removeCandidateFilters(OpWalkerInfo owi) { + if (HiveConf.getBoolVar(owi.getParseContext().getConf(), + HiveConf.ConfVars.HIVEPPDREMOVEDUPLICATEFILTERS)) { + // remove the candidate filter ops + for (FilterOperator fop : owi.getCandidateFilterOps()) { + List> children = fop.getChildOperators(); + List> parents = fop.getParentOperators(); + for (Operator parent : parents) { + parent.getChildOperators().addAll(children); + parent.removeChild(fop); + } + for (Operator child : children) { + child.getParentOperators().addAll(parents); + child.removeParent(fop); + } + } + owi.getCandidateFilterOps().clear(); + } + } + + /** * Attempts to push a predicate down into a storage handler. For * native tables, this is a no-op.