Package org.apache.calcite.sql.fun
Class SqlJsonQueryFunction
- java.lang.Object
-
- org.apache.calcite.sql.SqlOperator
-
- org.apache.calcite.sql.SqlFunction
-
- org.apache.calcite.sql.fun.SqlJsonQueryFunction
-
public class SqlJsonQueryFunction extends SqlFunction
TheJSON_QUERY
function.
-
-
Field Summary
-
Fields inherited from class org.apache.calcite.sql.SqlOperator
kind, MDX_PRECEDENCE, NL
-
-
Constructor Summary
Constructors Constructor Description SqlJsonQueryFunction()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SqlCall
createCall(SqlLiteral functionQualifier, SqlParserPos pos, SqlNode... operands)
Creates a call to this operand with an array of operands.private <E extends java.lang.Enum<E>>
EgetEnumValue(SqlNode operand)
java.lang.String
getSignatureTemplate(int operandsCount)
Returns a template describing how the operator signature is to be built.void
unparse(SqlWriter writer, SqlCall call, int leftPrec, int rightPrec)
Writes a SQL representation of a call to this operator to a writer, including parentheses if the operators on either side are of greater precedence.private void
unparseEmptyOrErrorBehavior(SqlWriter writer, SqlJsonQueryEmptyOrErrorBehavior emptyBehavior)
-
Methods inherited from class org.apache.calcite.sql.SqlFunction
deriveType, getFunctionType, getNameAsId, getParamNames, getParamTypes, getSqlIdentifier, getSyntax, isQuantifierAllowed, validateCall, validateQuantifier
-
Methods inherited from class org.apache.calcite.sql.SqlOperator
acceptCall, acceptCall, adjustType, allowsFraming, argumentMustBeScalar, checkOperandCount, checkOperandTypes, constructArgNameList, constructArgTypeList, constructOperandList, createCall, createCall, createCall, equals, getAllowedSignatures, getAllowedSignatures, getKind, getLeftPrec, getMonotonicity, getMonotonicity, getName, getOperandCountRange, getOperandTypeChecker, getOperandTypeInference, getReturnTypeInference, getRightPrec, hashCode, inferReturnType, inferReturnType, isAggregator, isDeterministic, isDynamicFunction, isGroup, isGroupAuxiliary, isName, leftPrec, preValidateCall, requiresDecimalExpansion, requiresOrder, requiresOver, rewriteCall, rightPrec, toString, unparseListClause, unparseListClause, validateOperands, validRexOperands
-
-
-
-
Method Detail
-
getSignatureTemplate
public java.lang.String getSignatureTemplate(int operandsCount)
Description copied from class:SqlOperator
Returns a template describing how the operator signature is to be built. E.g for the binary + operator the template looks like "{1} {0} {2}" {0} is the operator, subsequent numbers are operands.- Overrides:
getSignatureTemplate
in classSqlOperator
- Parameters:
operandsCount
- is used with functions that can take a variable number of operands- Returns:
- signature template, or null to indicate that a default template will suffice
-
unparse
public void unparse(SqlWriter writer, SqlCall call, int leftPrec, int rightPrec)
Description copied from class:SqlOperator
Writes a SQL representation of a call to this operator to a writer, including parentheses if the operators on either side are of greater precedence.The default implementation of this method delegates to
SqlSyntax.unparse(org.apache.calcite.sql.SqlWriter, org.apache.calcite.sql.SqlOperator, org.apache.calcite.sql.SqlCall, int, int)
.- Overrides:
unparse
in classSqlFunction
-
createCall
public SqlCall createCall(SqlLiteral functionQualifier, SqlParserPos pos, SqlNode... operands)
Description copied from class:SqlOperator
Creates a call to this operand with an array of operands.The position of the resulting call is the union of the
pos
and the positions of all of the operands.- Overrides:
createCall
in classSqlOperator
- Parameters:
functionQualifier
- function qualifier (e.g. "DISTINCT"), may bepos
- parser position of the identifier of the calloperands
- array of operands
-
unparseEmptyOrErrorBehavior
private void unparseEmptyOrErrorBehavior(SqlWriter writer, SqlJsonQueryEmptyOrErrorBehavior emptyBehavior)
-
getEnumValue
private <E extends java.lang.Enum<E>> E getEnumValue(SqlNode operand)
-
-