Package org.apache.calcite.adapter.druid
Class DirectOperatorConversion
- java.lang.Object
-
- org.apache.calcite.adapter.druid.DirectOperatorConversion
-
- All Implemented Interfaces:
DruidSqlOperatorConverter
public class DirectOperatorConversion extends java.lang.Object implements DruidSqlOperatorConverter
Direct operator conversion for expression like Function(exp_1,...exp_n)
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.String
druidFunctionName
private SqlOperator
operator
-
Constructor Summary
Constructors Constructor Description DirectOperatorConversion(SqlOperator operator, java.lang.String druidFunctionName)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SqlOperator
calciteOperator()
Returns the calcite SQL operator corresponding to Druid operator.java.lang.String
toDruidExpression(RexNode rexNode, RelDataType rowType, DruidQuery druidQuery)
Translate rexNode to valid Druid expression.
-
-
-
Field Detail
-
operator
private final SqlOperator operator
-
druidFunctionName
private final java.lang.String druidFunctionName
-
-
Constructor Detail
-
DirectOperatorConversion
public DirectOperatorConversion(SqlOperator operator, java.lang.String druidFunctionName)
-
-
Method Detail
-
calciteOperator
public SqlOperator calciteOperator()
Description copied from interface:DruidSqlOperatorConverter
Returns the calcite SQL operator corresponding to Druid operator.- Specified by:
calciteOperator
in interfaceDruidSqlOperatorConverter
- Returns:
- operator
-
toDruidExpression
public java.lang.String toDruidExpression(RexNode rexNode, RelDataType rowType, DruidQuery druidQuery)
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 rexNodedruidQuery
- druid query used to figure out configs/fields related like timeZone- Returns:
- valid Druid expression or null if it can not convert the rexNode
-
-