public class SqlFunction
extends org.apache.calcite.sql.SqlOperator
SqlFunction
is a type of operator which has conventional
function-call syntax.
This file is copied from Apache Calcite and should be removed once CALCITE-3360 has been fixed. Changed lines: 279-293
Modifier | Constructor and Description |
---|---|
|
SqlFunction(org.apache.calcite.sql.SqlIdentifier sqlIdentifier,
org.apache.calcite.sql.type.SqlReturnTypeInference returnTypeInference,
org.apache.calcite.sql.type.SqlOperandTypeInference operandTypeInference,
org.apache.calcite.sql.type.SqlOperandTypeChecker operandTypeChecker,
List<org.apache.calcite.rel.type.RelDataType> paramTypes,
org.apache.calcite.sql.SqlFunctionCategory funcType)
Creates a placeholder SqlFunction for an invocation of a function with a
possibly qualified name.
|
protected |
SqlFunction(String name,
org.apache.calcite.sql.SqlIdentifier sqlIdentifier,
org.apache.calcite.sql.SqlKind kind,
org.apache.calcite.sql.type.SqlReturnTypeInference returnTypeInference,
org.apache.calcite.sql.type.SqlOperandTypeInference operandTypeInference,
org.apache.calcite.sql.type.SqlOperandTypeChecker operandTypeChecker,
List<org.apache.calcite.rel.type.RelDataType> paramTypes,
org.apache.calcite.sql.SqlFunctionCategory category)
Internal constructor.
|
|
SqlFunction(String name,
org.apache.calcite.sql.SqlKind kind,
org.apache.calcite.sql.type.SqlReturnTypeInference returnTypeInference,
org.apache.calcite.sql.type.SqlOperandTypeInference operandTypeInference,
org.apache.calcite.sql.type.SqlOperandTypeChecker operandTypeChecker,
org.apache.calcite.sql.SqlFunctionCategory category)
Creates a new SqlFunction for a call to a builtin function.
|
Modifier and Type | Method and Description |
---|---|
org.apache.calcite.rel.type.RelDataType |
deriveType(org.apache.calcite.sql.validate.SqlValidator validator,
org.apache.calcite.sql.validate.SqlValidatorScope scope,
org.apache.calcite.sql.SqlCall call) |
org.apache.calcite.sql.SqlFunctionCategory |
getFunctionType() |
org.apache.calcite.sql.SqlIdentifier |
getNameAsId() |
List<String> |
getParamNames()
Returns a list of parameter names.
|
List<org.apache.calcite.rel.type.RelDataType> |
getParamTypes() |
org.apache.calcite.sql.SqlIdentifier |
getSqlIdentifier() |
org.apache.calcite.sql.SqlSyntax |
getSyntax() |
boolean |
isQuantifierAllowed()
Returns whether this function allows a
DISTINCT or
ALL quantifier. |
void |
unparse(org.apache.calcite.sql.SqlWriter writer,
org.apache.calcite.sql.SqlCall call,
int leftPrec,
int rightPrec) |
void |
validateCall(org.apache.calcite.sql.SqlCall call,
org.apache.calcite.sql.validate.SqlValidator validator,
org.apache.calcite.sql.validate.SqlValidatorScope scope,
org.apache.calcite.sql.validate.SqlValidatorScope operandScope) |
protected void |
validateQuantifier(org.apache.calcite.sql.validate.SqlValidator validator,
org.apache.calcite.sql.SqlCall call)
Throws a validation error if a DISTINCT or ALL quantifier is present but
not allowed.
|
acceptCall, acceptCall, adjustType, allowsFraming, argumentMustBeScalar, checkOperandCount, checkOperandTypes, constructArgNameList, constructArgTypeList, constructOperandList, createCall, createCall, createCall, createCall, equals, getAllowedSignatures, getAllowedSignatures, getKind, getLeftPrec, getMonotonicity, getMonotonicity, getName, getOperandCountRange, getOperandTypeChecker, getOperandTypeInference, getReturnTypeInference, getRightPrec, getSignatureTemplate, hashCode, inferReturnType, inferReturnType, isAggregator, isDeterministic, isDynamicFunction, isGroup, isGroupAuxiliary, isName, leftPrec, preValidateCall, requiresDecimalExpansion, requiresOrder, requiresOver, rewriteCall, rightPrec, toString, unparseListClause, unparseListClause, validateOperands, validRexOperands
public SqlFunction(String name, org.apache.calcite.sql.SqlKind kind, org.apache.calcite.sql.type.SqlReturnTypeInference returnTypeInference, org.apache.calcite.sql.type.SqlOperandTypeInference operandTypeInference, org.apache.calcite.sql.type.SqlOperandTypeChecker operandTypeChecker, org.apache.calcite.sql.SqlFunctionCategory category)
name
- Name of builtin functionkind
- kind of operator implemented by functionreturnTypeInference
- strategy to use for return type inferenceoperandTypeInference
- strategy to use for parameter type inferenceoperandTypeChecker
- strategy to use for parameter type checkingcategory
- categorization for functionpublic SqlFunction(org.apache.calcite.sql.SqlIdentifier sqlIdentifier, org.apache.calcite.sql.type.SqlReturnTypeInference returnTypeInference, org.apache.calcite.sql.type.SqlOperandTypeInference operandTypeInference, org.apache.calcite.sql.type.SqlOperandTypeChecker operandTypeChecker, List<org.apache.calcite.rel.type.RelDataType> paramTypes, org.apache.calcite.sql.SqlFunctionCategory funcType)
sqlIdentifier
- possibly qualified identifier for functionreturnTypeInference
- strategy to use for return type inferenceoperandTypeInference
- strategy to use for parameter type inferenceoperandTypeChecker
- strategy to use for parameter type checkingparamTypes
- array of parameter typesfuncType
- function categoryprotected SqlFunction(String name, org.apache.calcite.sql.SqlIdentifier sqlIdentifier, org.apache.calcite.sql.SqlKind kind, org.apache.calcite.sql.type.SqlReturnTypeInference returnTypeInference, org.apache.calcite.sql.type.SqlOperandTypeInference operandTypeInference, org.apache.calcite.sql.type.SqlOperandTypeChecker operandTypeChecker, List<org.apache.calcite.rel.type.RelDataType> paramTypes, org.apache.calcite.sql.SqlFunctionCategory category)
public org.apache.calcite.sql.SqlSyntax getSyntax()
getSyntax
in class org.apache.calcite.sql.SqlOperator
public org.apache.calcite.sql.SqlIdentifier getSqlIdentifier()
public org.apache.calcite.sql.SqlIdentifier getNameAsId()
getNameAsId
in class org.apache.calcite.sql.SqlOperator
public List<org.apache.calcite.rel.type.RelDataType> getParamTypes()
public List<String> getParamNames()
The default implementation returns [arg0, arg1, ..., argN]
.
public void unparse(org.apache.calcite.sql.SqlWriter writer, org.apache.calcite.sql.SqlCall call, int leftPrec, int rightPrec)
unparse
in class org.apache.calcite.sql.SqlOperator
@Nonnull public org.apache.calcite.sql.SqlFunctionCategory getFunctionType()
public boolean isQuantifierAllowed()
DISTINCT
or
ALL
quantifier. The default is false
; some aggregate
functions return true
.public void validateCall(org.apache.calcite.sql.SqlCall call, org.apache.calcite.sql.validate.SqlValidator validator, org.apache.calcite.sql.validate.SqlValidatorScope scope, org.apache.calcite.sql.validate.SqlValidatorScope operandScope)
validateCall
in class org.apache.calcite.sql.SqlOperator
protected void validateQuantifier(org.apache.calcite.sql.validate.SqlValidator validator, org.apache.calcite.sql.SqlCall call)
public org.apache.calcite.rel.type.RelDataType deriveType(org.apache.calcite.sql.validate.SqlValidator validator, org.apache.calcite.sql.validate.SqlValidatorScope scope, org.apache.calcite.sql.SqlCall call)
deriveType
in class org.apache.calcite.sql.SqlOperator
Copyright © 2014–2020 The Apache Software Foundation. All rights reserved.