public class DruidDateTimeUtils extends Object
| Modifier and Type | Field and Description |
|---|---|
protected static org.slf4j.Logger |
LOGGER |
| Modifier | Constructor and Description |
|---|---|
private |
DruidDateTimeUtils() |
| Modifier and Type | Method and Description |
|---|---|
static List<org.joda.time.Interval> |
createInterval(RexNode e,
String timeZone)
Generates a list of
Intervals equivalent to a given
expression. |
static Granularity |
extractGranularity(RexNode node,
String timeZone)
Infers granularity from a time unit.
|
protected static List<com.google.common.collect.Range<TimestampString>> |
extractRanges(RexNode node,
TimeZone timeZone,
boolean withNot) |
protected static List<com.google.common.collect.Range<TimestampString>> |
leafToRanges(RexCall call,
TimeZone timeZone,
boolean withNot) |
protected static TimestampString |
literalValue(RexNode node,
TimeZone timeZone) |
static Granularity.Type |
toDruidGranularity(org.apache.calcite.avatica.util.TimeUnitRange timeUnit)
Translates Calcite TimeUnitRange to Druid
Granularity |
protected static List<org.joda.time.Interval> |
toInterval(List<com.google.common.collect.Range<TimestampString>> ranges) |
static String |
toISOPeriodFormat(Granularity.Type type) |
@Nullable public static List<org.joda.time.Interval> createInterval(RexNode e, String timeZone)
Intervals equivalent to a given
expression. Assumes that all the predicates in the input
reference a single column: the timestamp column.protected static List<org.joda.time.Interval> toInterval(List<com.google.common.collect.Range<TimestampString>> ranges)
@Nullable protected static List<com.google.common.collect.Range<TimestampString>> extractRanges(RexNode node, TimeZone timeZone, boolean withNot)
@Nullable protected static List<com.google.common.collect.Range<TimestampString>> leafToRanges(RexCall call, TimeZone timeZone, boolean withNot)
@Nullable protected static TimestampString literalValue(RexNode node, TimeZone timeZone)
public static Granularity extractGranularity(RexNode node, String timeZone)
FLOOR(<time> TO <timeunit>)
and EXTRACT(<timeunit> FROM <time>).
Returns null if it cannot be inferred.node - the Rex node@Nullable public static String toISOPeriodFormat(Granularity.Type type)
type - Druid Granularity to translate as period of time@Nullable public static Granularity.Type toDruidGranularity(org.apache.calcite.avatica.util.TimeUnitRange timeUnit)
GranularitytimeUnit - Calcite Time unit to convertCopyright © 2012–2018 The Apache Software Foundation. All rights reserved.