Package org.apache.calcite.adapter.druid
Class UnarySuffixOperatorConversion
- java.lang.Object
-
- org.apache.calcite.adapter.druid.UnarySuffixOperatorConversion
-
- All Implemented Interfaces:
DruidSqlOperatorConverter
public class UnarySuffixOperatorConversion extends java.lang.Object implements DruidSqlOperatorConverter
Unary suffix operator conversion, used to convert function like: expression Unary_Operator
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.String
druidOperator
private SqlOperator
operator
-
Constructor Summary
Constructors Constructor Description UnarySuffixOperatorConversion(SqlOperator operator, java.lang.String druidOperator)
-
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
-
druidOperator
private final java.lang.String druidOperator
-
-
Constructor Detail
-
UnarySuffixOperatorConversion
public UnarySuffixOperatorConversion(SqlOperator operator, java.lang.String druidOperator)
-
-
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
-
-