Make EffectivePredicateExtractor not a subclass of PlanVisitor
Remove "extends PlanVisitor<Expression, Void>" from EffectivePredicateExtractor.
Instead, implement it in a nested static class.
@@ -63,11 +63,10 @@ import static com.google.common.collect.ImmutableList.toImmutableList;
* Note: non-deterministic predicates can not be pulled up (so they will be ignored)
*/
public class EffectivePredicateExtractor
- extends PlanVisitor<Expression, Void>
{
public static Expression extract(PlanNode node)
{
- return node.accept(new EffectivePredicateExtractor(), null);
+ return node.accept(new Visitor(), null);
}
private static final Predicate<Map.Entry<Symbol, ? extends Expression>> SYMBOL_MATCHES_EXPRESSION =
@@ -84,6 +83,9 @@ public class EffectivePredicateExtractor
private EffectivePredicateExtractor() {}
+ private static class Visitor
+ extends PlanVisitor<Expression, Void>
+ {
@Override
protected Expression visitPlan(PlanNode node, Void context)
{
@@ -311,3 +313,4 @@ public class EffectivePredicateExtractor
return combineConjuncts(effectiveConjuncts.build());
}
}
+}
