public class DruidDateTimeUtils extends Object
| Modifier and Type | Field and Description |
|---|---|
protected static org.slf4j.Logger |
LOGGER |
private static Pattern |
TIMESTAMP_PATTERN |
| Modifier | Constructor and Description |
|---|---|
private |
DruidDateTimeUtils() |
| Modifier and Type | Method and Description |
|---|---|
static List<org.joda.time.Interval> |
createInterval(RelDataType type,
RexNode e)
Generates a list of
Intervals equivalent to a given
expression. |
static String |
extractGranularity(RexCall call)
Extracts granularity from a call
FLOOR(<time> TO <timeunit>). |
private static RexLiteral |
extractLiteral(RexNode node) |
protected static List<com.google.common.collect.Range> |
extractRanges(RelDataType type,
RexNode node,
boolean withNot) |
static long |
extractTotalTime(List<org.joda.time.Interval> intervals)
Extract the total time span covered by these intervals.
|
protected static List<com.google.common.collect.Range> |
leafToRanges(RelDataType type,
RexCall call,
boolean withNot) |
protected static Comparable |
literalToType(RexLiteral literal,
RelDataType type) |
private static Double |
toDouble(Object literal) |
private static Float |
toFloat(Object literal) |
private static Integer |
toInt(Object literal) |
protected static List<org.joda.time.Interval> |
toInterval(List<com.google.common.collect.Range> ranges) |
private static Long |
toLong(Object literal) |
private static Comparable |
toTimestamp(Object literal) |
protected static final org.slf4j.Logger LOGGER
private static final Pattern TIMESTAMP_PATTERN
public static List<org.joda.time.Interval> createInterval(RelDataType type, RexNode e)
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> ranges)
protected static List<com.google.common.collect.Range> extractRanges(RelDataType type, RexNode node, boolean withNot)
protected static List<com.google.common.collect.Range> leafToRanges(RelDataType type, RexCall call, boolean withNot)
protected static Comparable literalToType(RexLiteral literal, RelDataType type)
private static RexLiteral extractLiteral(RexNode node)
private static Comparable toTimestamp(Object literal)
public static long extractTotalTime(List<org.joda.time.Interval> intervals)
intervals - list of intervalspublic static String extractGranularity(RexCall call)
FLOOR(<time> TO <timeunit>).
Timeunit specifies the granularity. Returns null if it cannot
be inferred.call - the function callCopyright © 2012–2016 The Apache Software Foundation. All rights reserved.