Package org.apache.calcite.sql2rel
Class StandardConvertletTable
- java.lang.Object
-
- org.apache.calcite.sql2rel.ReflectiveConvertletTable
-
- org.apache.calcite.sql2rel.StandardConvertletTable
-
- All Implemented Interfaces:
SqlRexConvertletTable
public class StandardConvertletTable extends ReflectiveConvertletTable
Standard implementation ofSqlRexConvertletTable
.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static class
StandardConvertletTable.AvgVarianceConvertlet
Convertlet that handlesAVG
andVARIANCE
windowed aggregate functions.private class
StandardConvertletTable.FloorCeilConvertlet
Convertlet that handlesFLOOR
andCEIL
functions.private static class
StandardConvertletTable.GreatestConvertlet
Convertlet that convertsGREATEST
andLEAST
.private static class
StandardConvertletTable.RegrCovarianceConvertlet
Convertlet that handlesCOVAR_POP
,COVAR_SAMP
,REGR_SXX
,REGR_SYY
windowed aggregate functions.private static class
StandardConvertletTable.TimestampAddConvertlet
Convertlet that handles theTIMESTAMPADD
function.private static class
StandardConvertletTable.TimestampDiffConvertlet
Convertlet that handles theTIMESTAMPDIFF
function.private static class
StandardConvertletTable.TrimConvertlet
Convertlet that convertsLTRIM
andRTRIM
toTRIM
.
-
Field Summary
Fields Modifier and Type Field Description static StandardConvertletTable
INSTANCE
Singleton instance.
-
Constructor Summary
Constructors Modifier Constructor Description private
StandardConvertletTable()
-
Method Summary
-
Methods inherited from class org.apache.calcite.sql2rel.ReflectiveConvertletTable
addAlias, get, registerOp
-
-
-
-
Field Detail
-
INSTANCE
public static final StandardConvertletTable INSTANCE
Singleton instance.
-
-
Method Detail
-
or
private RexNode or(RexBuilder rexBuilder, RexNode a0, RexNode a1)
-
eq
private RexNode eq(RexBuilder rexBuilder, RexNode a0, RexNode a1)
-
ge
private RexNode ge(RexBuilder rexBuilder, RexNode a0, RexNode a1)
-
le
private RexNode le(RexBuilder rexBuilder, RexNode a0, RexNode a1)
-
and
private RexNode and(RexBuilder rexBuilder, RexNode a0, RexNode a1)
-
divideInt
private static RexNode divideInt(RexBuilder rexBuilder, RexNode a0, RexNode a1)
-
plus
private RexNode plus(RexBuilder rexBuilder, RexNode a0, RexNode a1)
-
minus
private RexNode minus(RexBuilder rexBuilder, RexNode a0, RexNode a1)
-
multiply
private static RexNode multiply(RexBuilder rexBuilder, RexNode a0, RexNode a1)
-
case_
private RexNode case_(RexBuilder rexBuilder, RexNode... args)
-
plus
private SqlCall plus(SqlParserPos pos, SqlNode a0, SqlNode a1)
-
convertCase
public RexNode convertCase(SqlRexContext cx, SqlCase call)
Converts a CASE expression.
-
convertMultiset
public RexNode convertMultiset(SqlRexContext cx, SqlMultisetValueConstructor op, SqlCall call)
-
convertArray
public RexNode convertArray(SqlRexContext cx, SqlArrayValueConstructor op, SqlCall call)
-
convertMap
public RexNode convertMap(SqlRexContext cx, SqlMapValueConstructor op, SqlCall call)
-
convertMultisetQuery
public RexNode convertMultisetQuery(SqlRexContext cx, SqlMultisetQueryConstructor op, SqlCall call)
-
convertJdbc
public RexNode convertJdbc(SqlRexContext cx, SqlJdbcFunctionCall op, SqlCall call)
-
convertCast
protected RexNode convertCast(SqlRexContext cx, SqlCall call)
-
convertFloorCeil
protected RexNode convertFloorCeil(SqlRexContext cx, SqlCall call)
-
convertExtract
public RexNode convertExtract(SqlRexContext cx, SqlExtractFunction op, SqlCall call)
Converts a call to theEXTRACT
function.Called automatically via reflection.
-
mod
private RexNode mod(RexBuilder rexBuilder, RelDataType resType, RexNode res, java.math.BigDecimal val)
-
divide
private static RexNode divide(RexBuilder rexBuilder, RexNode res, java.math.BigDecimal val)
-
convertDatetimeMinus
public RexNode convertDatetimeMinus(SqlRexContext cx, SqlDatetimeSubtractionOperator op, SqlCall call)
-
convertFunction
public RexNode convertFunction(SqlRexContext cx, SqlFunction fun, SqlCall call)
-
convertSequenceValue
public RexNode convertSequenceValue(SqlRexContext cx, SqlSequenceValueOperator fun, SqlCall call)
-
convertAggregateFunction
public RexNode convertAggregateFunction(SqlRexContext cx, SqlAggFunction fun, SqlCall call)
-
makeConstructorCall
private static RexNode makeConstructorCall(SqlRexContext cx, SqlFunction constructor, java.util.List<RexNode> exprs)
-
convertCall
public RexNode convertCall(SqlRexContext cx, SqlCall call)
Converts a call to an operator into aRexCall
to the same operator.Called automatically via reflection.
- Parameters:
cx
- Contextcall
- Call- Returns:
- Rex call
-
convertCall
private RexNode convertCall(SqlRexContext cx, SqlCall call, SqlOperator op)
-
elseArgs
private java.util.List<java.lang.Integer> elseArgs(int count)
-
convertExpressionList
private static java.util.List<RexNode> convertExpressionList(SqlRexContext cx, java.util.List<SqlNode> nodes, SqlOperandTypeChecker.Consistency consistency)
-
consistentType
private static RelDataType consistentType(SqlRexContext cx, SqlOperandTypeChecker.Consistency consistency, java.util.List<RelDataType> types)
-
convertPlus
private RexNode convertPlus(SqlRexContext cx, SqlCall call)
-
convertIsDistinctFrom
private RexNode convertIsDistinctFrom(SqlRexContext cx, SqlCall call, boolean neg)
-
convertBetween
public RexNode convertBetween(SqlRexContext cx, SqlBetweenOperator op, SqlCall call)
Converts a BETWEEN expression.Called automatically via reflection.
-
convertLiteralChain
public RexNode convertLiteralChain(SqlRexContext cx, SqlLiteralChainOperator op, SqlCall call)
Converts a LiteralChain expression: that is, concatenates the operands immediately, to produce a single literal string.Called automatically via reflection.
-
convertRow
public RexNode convertRow(SqlRexContext cx, SqlRowOperator op, SqlCall call)
Converts a ROW.Called automatically via reflection.
-
convertOverlaps
public RexNode convertOverlaps(SqlRexContext cx, SqlOverlapsOperator op, SqlCall call)
Converts a call to OVERLAPS.Called automatically via reflection.
-
convertOverlapsOperand
private Pair<RexNode,RexNode> convertOverlapsOperand(SqlRexContext cx, SqlParserPos pos, SqlNode operand)
-
castToValidatedType
public RexNode castToValidatedType(SqlRexContext cx, SqlCall call, RexNode value)
Casts a RexNode value to the validated type of a SqlCall. If the value was already of the validated type, then the value is returned without an additional cast.
-
castToValidatedType
public static RexNode castToValidatedType(SqlNode node, RexNode e, SqlValidator validator, RexBuilder rexBuilder)
Casts a RexNode value to the validated type of a SqlCall. If the value was already of the validated type, then the value is returned without an additional cast.
-
-