@Test public void transformTest1() throws Exception { TupleFilter or = new LogicalTupleFilter(TupleFilter.FilterOperatorEnum.OR); TupleFilter a = new CompareTupleFilter(TupleFilter.FilterOperatorEnum.EQ); TupleFilter b = ConstantTupleFilter.FALSE; or.addChild(a); or.addChild(b); or = new FilterOptimizeTransformer().transform(or); Assert.assertEquals(1, or.children.size()); }
@Override public TupleFilter transform(TupleFilter tupleFilter) { if (tupleFilter == null || !(tupleFilter instanceof IOptimizeableTupleFilter)) return tupleFilter; else return ((IOptimizeableTupleFilter) tupleFilter).acceptOptimizeTransformer(this); }
FilterOptimizeTransformer implements ITupleFilterTransformer { @Override public TupleFilter transform(TupleFilter tupleFilter) { if (tupleFilter == null || !(tupleFilter instanceof IOptimizeableTupleFilter)) return tupleFilter; else return ((IOptimizeableTupleFilter) tupleFilter).acceptOptimizeTransformer(this); } }
FilterOptimizeTransformer implements ITupleFilterTransformer { @Override public TupleFilter transform(TupleFilter tupleFilter) { if (tupleFilter == null || !(tupleFilter instanceof IOptimizeableTupleFilter)) return tupleFilter; else return ((IOptimizeableTupleFilter) tupleFilter).acceptOptimizeTransformer(this); }  }
FilterOptimizeTransformer implements ITupleFilterTransformer { @Override public TupleFilter transform(TupleFilter tupleFilter) { if (tupleFilter == null || !(tupleFilter instanceof IOptimizeableTupleFilter)) return tupleFilter; else return ((IOptimizeableTupleFilter) tupleFilter).acceptOptimizeTransformer(this); }  @Override TupleFilter transform(TupleFilter tupleFilter); TupleFilter visit(CompareTupleFilter compareTupleFilter); TupleFilter visit(LogicalTupleFilter logicalTupleFilter); TupleFilter visit(CaseTupleFilter caseTupleFilter); }
FilterOptimizeTransformer implements ITupleFilterTransformer { @Override public TupleFilter transform(TupleFilter tupleFilter) { if (tupleFilter == null || !(tupleFilter instanceof IOptimizeableTupleFilter)) return tupleFilter; else return ((IOptimizeableTupleFilter) tupleFilter).acceptOptimizeTransformer(this); }  @Override TupleFilter transform(TupleFilter tupleFilter); TupleFilter visit(CompareTupleFilter compareTupleFilter); TupleFilter visit(LogicalTupleFilter logicalTupleFilter); TupleFilter visit(CaseTupleFilter caseTupleFilter); static final Logger logger; }