@Test public void transformTest4() throws Exception { TupleFilter or = new LogicalTupleFilter(TupleFilter.FilterOperatorEnum.AND); TupleFilter a = ConstantTupleFilter.FALSE; TupleFilter b = ConstantTupleFilter.FALSE; or.addChild(a); or.addChild(b); or = new FilterOptimizeTransformer().transform(or); Assert.assertEquals(ConstantTupleFilter.FALSE, or); }
@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; }