public class SqlCallBinding extends SqlOperatorBinding
SqlCallBinding implements SqlOperatorBinding by
analyzing to the operands of a SqlCall with a SqlValidator.typeFactory| Constructor and Description |
|---|
SqlCallBinding(SqlValidator validator,
SqlValidatorScope scope,
SqlCall call)
Creates a call binding.
|
| Modifier and Type | Method and Description |
|---|---|
SqlCall |
getCall()
Returns the call node.
|
String |
getColumnListParamInfo(int ordinal,
String paramName,
List<String> columnList)
Retrieves information about a column list parameter.
|
RelDataType |
getCursorOperand(int ordinal)
Returns the rowtype of the
ordinalth operand, which is a
cursor. |
int |
getGroupCount()
If the operator call occurs in an aggregate query, returns the number of
columns in the GROUP BY clause.
|
int |
getIntLiteralOperand(int ordinal)
Gets the integer value of a numeric literal operand.
|
int |
getOperandCount() |
RelDataType |
getOperandType(int ordinal)
Gets the type of a bound operand.
|
SqlValidatorScope |
getScope()
Returns the scope of the call.
|
String |
getStringLiteralOperand(int ordinal)
Gets the string value of a string literal operand.
|
SqlValidator |
getValidator()
Returns the validator.
|
boolean |
isOperandNull(int ordinal,
boolean allowCast)
Determines whether a bound operand is NULL.
|
CalciteException |
newError(Resources.ExInst<SqlValidatorException> e)
Wraps a validation error with context appropriate to this operator call.
|
CalciteException |
newValidationError(Resources.ExInst<SqlValidatorException> ex)
Constructs a new validation error for the call.
|
CalciteException |
newValidationSignatureError()
Constructs a new validation signature error for the call.
|
collectOperandTypes, getOperator, getTypeFactorypublic SqlCallBinding(SqlValidator validator, SqlValidatorScope scope, SqlCall call)
validator - Validatorscope - Scope of callcall - Call nodepublic int getGroupCount()
SqlOperatorBindingReturns 0 if the query is implicitly "GROUP BY ()" because of an aggregate expression. For example, "SELECT sum(sal) FROM emp".
Returns -1 if the query is not an aggregate query.
getGroupCount in class SqlOperatorBindingpublic SqlValidator getValidator()
public SqlValidatorScope getScope()
public SqlCall getCall()
public String getStringLiteralOperand(int ordinal)
SqlOperatorBindinggetStringLiteralOperand in class SqlOperatorBindingordinal - zero-based ordinal of operand of interestpublic int getIntLiteralOperand(int ordinal)
SqlOperatorBindinggetIntLiteralOperand in class SqlOperatorBindingordinal - zero-based ordinal of operand of interestpublic boolean isOperandNull(int ordinal,
boolean allowCast)
SqlOperatorBindingThis is only relevant for SQL validation.
isOperandNull in class SqlOperatorBindingordinal - zero-based ordinal of operand of interestallowCast - whether to regard CAST(constant) as a constantpublic int getOperandCount()
getOperandCount in class SqlOperatorBindingpublic RelDataType getOperandType(int ordinal)
SqlOperatorBindinggetOperandType in class SqlOperatorBindingordinal - zero-based ordinal of operand of interestpublic RelDataType getCursorOperand(int ordinal)
SqlOperatorBindingordinalth operand, which is a
cursor.
This is only implemented for SqlCallBinding.
getCursorOperand in class SqlOperatorBindingordinal - Ordinal of the operandpublic String getColumnListParamInfo(int ordinal, String paramName, List<String> columnList)
SqlOperatorBindinggetColumnListParamInfo in class SqlOperatorBindingordinal - ordinal position of the column list parameterparamName - name of the column list parametercolumnList - returns a list of the column names that are referenced
in the column list parameterpublic CalciteException newError(Resources.ExInst<SqlValidatorException> e)
SqlOperatorBindingnewError in class SqlOperatorBindinge - Validation error, not nullpublic CalciteException newValidationSignatureError()
public CalciteException newValidationError(Resources.ExInst<SqlValidatorException> ex)
ex - underlying exceptionCopyright © 2012–2015 The Apache Software Foundation. All rights reserved.