/** * Generates a list of {@link Interval}s equivalent to a given * expression. Assumes that all the predicates in the input * reference a single column: the timestamp column. */ public static List<Interval> createInterval(RexNode e, String timeZone) { final List<Range<TimestampString>> ranges = extractRanges(e, TimeZone.getTimeZone(timeZone), false); if (ranges == null) { // We did not succeed, bail out return null; } final TreeRangeSet condensedRanges = TreeRangeSet.create(); for (Range r : ranges) { condensedRanges.add(r); } if (LOGGER.isDebugEnabled()) { LOGGER.debug("Inferred ranges on interval : " + condensedRanges); } return toInterval( ImmutableList.<Range>copyOf(condensedRanges.asRanges())); }
/** * Generates a list of {@link Interval}s equivalent to a given * expression. Assumes that all the predicates in the input * reference a single column: the timestamp column. */ @Nullable public static List<Interval> createInterval(RexNode e) { final List<Range<Long>> ranges = extractRanges(e, false); if (ranges == null) { // We did not succeed, bail out return null; } final TreeRangeSet condensedRanges = TreeRangeSet.create(); for (Range r : ranges) { condensedRanges.add(r); } if (LOGGER.isDebugEnabled()) { LOGGER.debug("Inferred ranges on interval : " + condensedRanges); } return toInterval( ImmutableList.<Range>copyOf(condensedRanges.asRanges())); }