public class DruidExpressions extends Object
| Modifier and Type | Field and Description |
|---|---|
(package private) static Map<SqlTypeName,DruidType> |
EXPRESSION_TYPES
Type mapping between Calcite SQL family types and native Druid expression types
|
private static char[] |
SAFE_CHARS
Druid expression safe chars, must be sorted.
|
| Modifier | Constructor and Description |
|---|---|
private |
DruidExpressions() |
| Modifier and Type | Method and Description |
|---|---|
static String |
applyTimeExtract(String timeExpression,
String druidUnit,
TimeZone timeZone) |
static String |
applyTimestampCeil(String input,
String granularity,
String origin,
TimeZone timeZone) |
static String |
applyTimestampFloor(String input,
String granularity,
String origin,
TimeZone timeZone) |
private static String |
escape(String s) |
static String |
fromColumn(String columnName) |
static String |
functionCall(String functionName,
List<String> args) |
static String |
nAryOperatorCall(String druidOperator,
List<String> args) |
static String |
nullLiteral() |
static String |
numberLiteral(Number n) |
static String |
stringLiteral(String s) |
static String |
toDruidExpression(RexNode rexNode,
RelDataType inputRowType,
DruidQuery druidRel)
Translates Calcite rexNode to Druid Expression when possible
|
static List<String> |
toDruidExpressions(DruidQuery druidRel,
RelDataType rowType,
List<RexNode> rexNodes)
Translate a list of Calcite
RexNode to Druid expressions. |
static final Map<SqlTypeName,DruidType> EXPRESSION_TYPES
private static final char[] SAFE_CHARS
@Nullable public static String toDruidExpression(RexNode rexNode, RelDataType inputRowType, DruidQuery druidRel)
rexNode - rexNode to convert to a Druid ExpressioninputRowType - input row type of the rexNode to translatedruidRel - Druid querypublic static String nullLiteral()
@Nullable public static List<String> toDruidExpressions(DruidQuery druidRel, RelDataType rowType, List<RexNode> rexNodes)
RexNode to Druid expressions.rexNodes - list of Calcite expressions meant to be applied on top of the rowspublic static String applyTimestampFloor(String input, String granularity, String origin, TimeZone timeZone)
public static String applyTimestampCeil(String input, String granularity, String origin, TimeZone timeZone)
Copyright © 2012–2018 The Apache Software Foundation. All rights reserved.