public class SqlDynamicParam extends SqlNode
SqlDynamicParam represents a dynamic parameter marker in an
SQL statement. The textual order in which dynamic parameters appear within an
SQL statement is the only property which distinguishes them, so this 0-based
index is recorded as soon as the parameter is encountered.EMPTY_ARRAY, pos| Constructor and Description |
|---|
SqlDynamicParam(int index,
SqlParserPos pos) |
| Modifier and Type | Method and Description |
|---|---|
<R> R |
accept(SqlVisitor<R> visitor)
Accepts a generic visitor.
|
SqlNode |
clone(SqlParserPos pos)
Clones a SqlNode with a different position.
|
boolean |
equalsDeep(SqlNode node,
boolean fail)
Returns whether this node is structurally equivalent to another node.
|
int |
getIndex() |
SqlKind |
getKind()
Returns the type of node this is, or
SqlKind.OTHER if it's nothing special. |
SqlMonotonicity |
getMonotonicity(SqlValidatorScope scope)
Returns whether expression is always ascending, descending or constant.
|
void |
unparse(SqlWriter writer,
int leftPrec,
int rightPrec)
Writes a SQL representation of this node to a writer.
|
void |
validate(SqlValidator validator,
SqlValidatorScope scope)
Validates this node.
|
clone, cloneArray, equalDeep, equalDeep, findValidOptions, getParserPosition, isA, toSqlString, toSqlString, toString, validateExprpublic SqlDynamicParam(int index,
SqlParserPos pos)
public SqlNode clone(SqlParserPos pos)
SqlNodepublic SqlKind getKind()
SqlNodeSqlKind.OTHER if it's nothing special.getKind in class SqlNodeSqlKind value, never nullSqlNode.isA(java.util.Set<org.apache.calcite.sql.SqlKind>)public int getIndex()
public void unparse(SqlWriter writer, int leftPrec, int rightPrec)
SqlNodeThe leftPrec and rightPrec parameters give
us enough context to decide whether we need to enclose the expression in
parentheses. For example, we need parentheses around "2 + 3" if preceded
by "5 *". This is because the precedence of the "*" operator is greater
than the precedence of the "+" operator.
The algorithm handles left- and right-associative operators by giving them slightly different left- and right-precedence.
If SqlWriter.isAlwaysUseParentheses() is true, we use
parentheses even when they are not required by the precedence rules.
For the details of this algorithm, see SqlCall.unparse(org.apache.calcite.sql.SqlWriter, int, int).
public void validate(SqlValidator validator, SqlValidatorScope scope)
SqlNodeThe typical implementation of this method will make a callback to the
validator appropriate to the node type and context. The validator has
methods such as SqlValidator.validateLiteral(org.apache.calcite.sql.SqlLiteral) for these purposes.
public SqlMonotonicity getMonotonicity(SqlValidatorScope scope)
SqlNodeThe default implementation returns
SqlMonotonicity.NOT_MONOTONIC.
getMonotonicity in class SqlNodepublic <R> R accept(SqlVisitor<R> visitor)
SqlNodeImplementations of this method in subtypes simply call the appropriate
visit method on the
visitor object.
The type parameter R must be consistent with the type
parameter of the visitor.
public boolean equalsDeep(SqlNode node, boolean fail)
SqlNodeequalsDeep in class SqlNodeCopyright © 2012–2015 The Apache Software Foundation. All rights reserved.