@Test public void testLegacyCubeSeg() { CubeInstance cube = CubeManager.getInstance(getTestConfig()) .getCube("test_kylin_cube_without_slr_left_join_ready_2_segments"); TblColRef col = cube.getModel().findColumn("TEST_KYLIN_FACT.CAL_DT"); CubeSegment seg = cube.getSegments(SegmentStatusEnum.READY).get(0); TSRange tsRange = seg.getTSRange(); long start = tsRange.start.v; try (SetAndUnsetSystemProp sns = new SetAndUnsetSystemProp("kylin.query.skip-empty-segments", "false")) { { TupleFilter f = compare(col, FilterOperatorEnum.LTE, start); SegmentPruner segmentPruner = new SegmentPruner(f); Assert.assertTrue(segmentPruner.check(seg)); } { TupleFilter f = compare(col, FilterOperatorEnum.LT, start); SegmentPruner segmentPruner = new SegmentPruner(f); Assert.assertFalse(segmentPruner.check(seg)); } } }
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);  }