Package org.apache.calcite.adapter.druid
Class ExtractOperatorConversion
java.lang.Object
org.apache.calcite.adapter.druid.ExtractOperatorConversion
- All Implemented Interfaces:
DruidSqlOperatorConverter
Time extract operator conversion for expressions like
EXTRACT(timeUnit FROM arg)
.
Unit can be SECOND, MINUTE, HOUR, DAY (day of month), DOW (day of week), DOY (day of year), WEEK (week of week year), MONTH (1 through 12), QUARTER (1 through 4), or YEAR.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionReturns the calcite SQL operator corresponding to Druid operator.@Nullable String
toDruidExpression
(RexNode rexNode, RelDataType rowType, DruidQuery query) Translate rexNode to valid Druid expression.
-
Constructor Details
-
ExtractOperatorConversion
public ExtractOperatorConversion()
-
-
Method Details
-
calciteOperator
Description copied from interface:DruidSqlOperatorConverter
Returns the calcite SQL operator corresponding to Druid operator.- Specified by:
calciteOperator
in interfaceDruidSqlOperatorConverter
- Returns:
- operator
-
toDruidExpression
Description copied from interface:DruidSqlOperatorConverter
Translate rexNode to valid Druid expression.- Specified by:
toDruidExpression
in interfaceDruidSqlOperatorConverter
- Parameters:
rexNode
- rexNode to translate to Druid expressionrowType
- row type associated with rexNodequery
- druid query used to figure out configs/fields related like timeZone- Returns:
- valid Druid expression or null if it can not convert the rexNode
-