public abstract class DateRangeRules extends Object
EXTRACT(timeUnit FROM dateTime) = constant,
FLOOR(dateTime to timeUnit = constant} and
CEIL(dateTime to timeUnit = constant} to
dateTime BETWEEN lower AND upper.
The rules allow conversion of queries on time dimension tables, such as
SELECT ... FROM sales JOIN time_by_day USING (time_id) WHERE time_by_day.the_year = 1997 AND time_by_day.the_month IN (4, 5, 6)
into
SELECT ... FROM sales JOIN time_by_day USING (time_id) WHERE the_date BETWEEN DATE '2016-04-01' AND DATE '2016-06-30'
and is especially useful for Druid, which has a single timestamp column.
| Modifier and Type | Class and Description |
|---|---|
static class |
DateRangeRules.FilterDateRangeRule
Rule that converts EXTRACT, FLOOR and CEIL in a
Filter into a date
range. |
| Modifier and Type | Field and Description |
|---|---|
static RelOptRule |
FILTER_INSTANCE
Rule that matches a
Filter and converts calls to EXTRACT,
FLOOR and CEIL functions to date ranges (typically using
the BETWEEN operator). |
| Modifier and Type | Method and Description |
|---|---|
static RexNode |
replaceTimeUnits(RexBuilder rexBuilder,
RexNode e,
String timeZone)
Replaces calls to EXTRACT, FLOOR and CEIL in an expression.
|
public static final RelOptRule FILTER_INSTANCE
Filter and converts calls to EXTRACT,
FLOOR and CEIL functions to date ranges (typically using
the BETWEEN operator).public static RexNode replaceTimeUnits(RexBuilder rexBuilder, RexNode e, String timeZone)
Copyright © 2012-2022 Apache Software Foundation. All Rights Reserved.