private boolean columnOverlaps(ColumnReference<C> columnReference, Domain predicateDomain, long numberOfRows, ColumnStatistics columnStatistics) if (!stripeDomain.overlaps(predicateDomain)) {
@Test public void testOverlaps() { assertTrue(Domain.all(BIGINT).overlaps(Domain.all(BIGINT))); assertFalse(Domain.all(BIGINT).overlaps(Domain.none(BIGINT))); assertTrue(Domain.all(BIGINT).overlaps(Domain.notNull(BIGINT))); assertTrue(Domain.all(BIGINT).overlaps(Domain.onlyNull(BIGINT))); assertTrue(Domain.all(BIGINT).overlaps(Domain.singleValue(BIGINT, 0L))); assertFalse(Domain.none(BIGINT).overlaps(Domain.all(BIGINT))); assertFalse(Domain.none(BIGINT).overlaps(Domain.none(BIGINT))); assertFalse(Domain.none(BIGINT).overlaps(Domain.notNull(BIGINT))); assertFalse(Domain.none(BIGINT).overlaps(Domain.onlyNull(BIGINT))); assertFalse(Domain.none(BIGINT).overlaps(Domain.singleValue(BIGINT, 0L))); assertTrue(Domain.notNull(BIGINT).overlaps(Domain.all(BIGINT))); assertFalse(Domain.notNull(BIGINT).overlaps(Domain.none(BIGINT))); assertTrue(Domain.notNull(BIGINT).overlaps(Domain.notNull(BIGINT))); assertFalse(Domain.notNull(BIGINT).overlaps(Domain.onlyNull(BIGINT))); assertTrue(Domain.notNull(BIGINT).overlaps(Domain.singleValue(BIGINT, 0L))); assertTrue(Domain.onlyNull(BIGINT).overlaps(Domain.all(BIGINT))); assertFalse(Domain.onlyNull(BIGINT).overlaps(Domain.none(BIGINT))); assertFalse(Domain.onlyNull(BIGINT).overlaps(Domain.notNull(BIGINT))); assertTrue(Domain.onlyNull(BIGINT).overlaps(Domain.onlyNull(BIGINT))); assertFalse(Domain.onlyNull(BIGINT).overlaps(Domain.singleValue(BIGINT, 0L))); assertTrue(Domain.singleValue(BIGINT, 0L).overlaps(Domain.all(BIGINT))); assertFalse(Domain.singleValue(BIGINT, 0L).overlaps(Domain.none(BIGINT))); assertTrue(Domain.singleValue(BIGINT, 0L).overlaps(Domain.notNull(BIGINT))); assertFalse(Domain.singleValue(BIGINT, 0L).overlaps(Domain.onlyNull(BIGINT))); assertTrue(Domain.singleValue(BIGINT, 0L).overlaps(Domain.singleValue(BIGINT, 0L))); }
@Override public ConnectorSplitSource getSplits(ConnectorTransactionHandle transactionHandle, ConnectorSession session, ConnectorTableLayoutHandle layoutHandle, SplitSchedulingStrategy splitSchedulingStrategy) { AtopTableLayoutHandle handle = (AtopTableLayoutHandle) layoutHandle; AtopTableHandle table = handle.getTableHandle(); List<ConnectorSplit> splits = new ArrayList<>(); ZonedDateTime end = ZonedDateTime.now(timeZone); for (Node node : nodeManager.getWorkerNodes()) { ZonedDateTime start = end.minusDays(maxHistoryDays - 1).withHour(0).withMinute(0).withSecond(0).withNano(0); while (start.isBefore(end)) { ZonedDateTime splitEnd = start.withHour(23).withMinute(59).withSecond(59).withNano(0); Domain splitDomain = Domain.create(ValueSet.ofRanges(Range.range(TIMESTAMP_WITH_TIME_ZONE, 1000 * start.toEpochSecond(), true, 1000 * splitEnd.toEpochSecond(), true)), false); if (handle.getStartTimeConstraint().overlaps(splitDomain) && handle.getEndTimeConstraint().overlaps(splitDomain)) { splits.add(new AtopSplit(table.getTable(), node.getHostAndPort(), start.toEpochSecond(), start.getZone())); } start = start.plusDays(1).withHour(0).withMinute(0).withSecond(0).withNano(0); } } return new FixedSplitSource(splits); } }
private boolean columnOverlaps(ColumnReference<C> columnReference, Domain predicateDomain, long numberOfRows, ColumnStatistics columnStatistics) if (!stripeDomain.overlaps(predicateDomain)) {