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
ordinal th 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.
|
EigenbaseException |
newError(Resources.ExInst<SqlValidatorException> e)
Wraps a validation error with context appropriate to this operator call.
|
EigenbaseException |
newValidationError(Resources.ExInst<SqlValidatorException> ex)
Constructs a new validation error for the call.
|
EigenbaseException |
newValidationSignatureError()
Constructs a new validation signature error for the call.
|
collectOperandTypes, getOperator, getTypeFactory
public SqlCallBinding(SqlValidator validator, SqlValidatorScope scope, SqlCall call)
validator
- Validatorscope
- Scope of callcall
- Call nodepublic int getGroupCount()
SqlOperatorBinding
Returns 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 SqlOperatorBinding
public SqlValidator getValidator()
public SqlValidatorScope getScope()
public SqlCall getCall()
public String getStringLiteralOperand(int ordinal)
SqlOperatorBinding
getStringLiteralOperand
in class SqlOperatorBinding
ordinal
- zero-based ordinal of operand of interestpublic int getIntLiteralOperand(int ordinal)
SqlOperatorBinding
getIntLiteralOperand
in class SqlOperatorBinding
ordinal
- zero-based ordinal of operand of interestpublic boolean isOperandNull(int ordinal, boolean allowCast)
SqlOperatorBinding
This is only relevant for SQL validation.
isOperandNull
in class SqlOperatorBinding
ordinal
- zero-based ordinal of operand of interestallowCast
- whether to regard CAST(constant) as a constantpublic int getOperandCount()
getOperandCount
in class SqlOperatorBinding
public RelDataType getOperandType(int ordinal)
SqlOperatorBinding
getOperandType
in class SqlOperatorBinding
ordinal
- zero-based ordinal of operand of interestpublic RelDataType getCursorOperand(int ordinal)
SqlOperatorBinding
ordinal
th operand, which is a
cursor.
This is only implemented for SqlCallBinding
.
getCursorOperand
in class SqlOperatorBinding
ordinal
- Ordinal of the operandpublic String getColumnListParamInfo(int ordinal, String paramName, List<String> columnList)
SqlOperatorBinding
getColumnListParamInfo
in class SqlOperatorBinding
ordinal
- 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 EigenbaseException newError(Resources.ExInst<SqlValidatorException> e)
SqlOperatorBinding
newError
in class SqlOperatorBinding
e
- Validation error, not nullpublic EigenbaseException newValidationSignatureError()
public EigenbaseException newValidationError(Resources.ExInst<SqlValidatorException> ex)
ex
- underlying exceptionCopyright © 2012–2014 The Apache Software Foundation. All rights reserved.