@Test public void testDynamicFilter() { CubeSegment seg = cube.getFirstSegment(); TblColRef col = cube.getModel().findColumn("CUSTOMER.C_NATION"); { DynamicTupleFilter dyna = new DynamicTupleFilter("$0"); CompareTupleFilter f = compare(col, FilterOperatorEnum.EQ, dyna); f.bindVariable("$0", "CHINA"); SegmentPruner segmentPruner = new SegmentPruner(f); Assert.assertTrue(segmentPruner.check(seg)); } { DynamicTupleFilter dyna = new DynamicTupleFilter("$0"); CompareTupleFilter f = compare(col, FilterOperatorEnum.EQ, dyna); f.bindVariable("$0", "XXXX"); SegmentPruner segmentPruner = new SegmentPruner(f); Assert.assertTrue(segmentPruner.check(seg) == false); } }
public boolean check(CubeSegment seg) { if (seg.getInputRecords() == 0) { if (seg.getConfig().isSkippingEmptySegments()) { logger.debug("Prune segment {} due to 0 input record", seg); return false; } else { logger.debug("Insist scan of segment {} having 0 input record", seg); } } if (!node.checkSeg(seg)) { logger.debug("Prune segment {} due to given filter", seg); return false; } logger.debug("Pruner passed on segment {}", seg); return true; }
SegmentPruner { public boolean check(CubeSegment seg) { if (seg.getInputRecords() == 0) { if (seg.getConfig().isSkippingEmptySegments()) { logger.debug("Prune segment {} due to 0 input record", seg); return false; } else { logger.debug("Insist scan of segment {} having 0 input record", seg); } } if (!node.checkSeg(seg)) { logger.debug("Prune segment {} due to given filter", seg); return false; } logger.debug("Pruner passed on segment {}", seg); return true; } }
SegmentPruner { public boolean check(CubeSegment seg) { if (seg.getInputRecords() == 0) { if (seg.getConfig().isSkippingEmptySegments()) { logger.debug("Prune segment {} due to 0 input record", seg); return false; } else { logger.debug("Insist scan of segment {} having 0 input record", seg); } } if (!node.checkSeg(seg)) { logger.debug("Prune segment {} due to given filter", seg); return false; } logger.debug("Pruner passed on segment {}", seg); return true; } SegmentPruner(TupleFilter filter); }
SegmentPruner { public boolean check(CubeSegment seg) { if (seg.getInputRecords() == 0) { if (seg.getConfig().isSkippingEmptySegments()) { logger.debug("Prune segment {} due to 0 input record", seg); return false; } else { logger.debug("Insist scan of segment {} having 0 input record", seg); } } if (!node.checkSeg(seg)) { logger.debug("Prune segment {} due to given filter", seg); return false; } logger.debug("Pruner passed on segment {}", seg); return true; } SegmentPruner(TupleFilter filter); List<CubeSegment> listSegmentsForQuery(CubeInstance cube); boolean check(CubeSegment seg); static DimensionRangeInfo tryDeduceRangeFromPartitionCol(CubeSegment seg, TblColRef col); static boolean satisfy(CompareTupleFilter comp, String minVal, String maxVal); }
SegmentPruner { public boolean check(CubeSegment seg) { if (seg.getInputRecords() == 0) { if (seg.getConfig().isSkippingEmptySegments()) { logger.debug("Prune segment {} due to 0 input record", seg); return false; } else { logger.debug("Insist scan of segment {} having 0 input record", seg); } } if (!node.checkSeg(seg)) { logger.debug("Prune segment {} due to given filter", seg); return false; } logger.debug("Pruner passed on segment {}", seg); return true; } SegmentPruner(TupleFilter filter); List<CubeSegment> listSegmentsForQuery(CubeInstance cube); boolean check(CubeSegment seg); static DimensionRangeInfo tryDeduceRangeFromPartitionCol(CubeSegment seg, TblColRef col); static boolean satisfy(CompareTupleFilter comp, String minVal, String maxVal);  }