public abstract class ValueNode extends QueryTreeNode
AUTOINCREMENT_CREATE_MODIFY, AUTOINCREMENT_INC_INDEX, AUTOINCREMENT_IS_AUTOINCREMENT_INDEX, AUTOINCREMENT_START_INDEX
Constructor and Description |
---|
ValueNode() |
Modifier and Type | Method and Description |
---|---|
void |
copyFrom(QueryTreeNode node)
Fill this node with a deep copy of the given node.
|
java.lang.String |
getColumnName()
This is null so that the caller will substitute in the resultset generated
name as needed.
|
java.lang.String |
getSchemaName()
This returns the user-supplied schema name of the column.
|
ResultColumn |
getSourceResultColumn()
Get the source for this ValueNode.
|
java.lang.String |
getTableName()
This returns the user-supplied table name of the column.
|
DataTypeDescriptor |
getType()
Get the DataTypeDescriptor from this ValueNode.
|
TypeId |
getTypeId()
Get the TypeId from this ValueNode.
|
void |
init(java.lang.Object typeId,
java.lang.Object precision,
java.lang.Object scale,
java.lang.Object isNullable,
java.lang.Object maximumWidth)
Initializer for numeric types.
|
boolean |
isBinaryEqualsOperatorNode()
Returns true if this value node is a equals operator.
|
boolean |
isBooleanFalse()
Does this represent a false constant.
|
boolean |
isBooleanTrue()
Does this represent a true constant.
|
boolean |
isConstantExpression()
Return whether or not this expression tree represents a constant expression.
|
protected abstract boolean |
isEquivalent(ValueNode other)
Tests if this node is equivalent to the specified ValueNode.
|
boolean |
isInListProbeNode()
Returns true if this value node is an operator created
for optimized performance of an IN list.
|
boolean |
isParameterNode()
Returns TRUE if this is a parameter node.
|
boolean |
isRelationalOperator()
Returns true if this ValueNode is a relational operator.
|
protected boolean |
isSameNodeType(ValueNode other)
Tests if this node is of the same type as the specified node as
reported by
QueryTreeNode.getNodeType() . |
void |
setNullability(boolean nullability)
Set the nullability of this value.
|
void |
setType(DataTypeDescriptor type)
Set the DataTypeDescriptor for this ValueNode.
|
java.lang.String |
toString()
Convert this object to a String.
|
accept, convertDefaultNode, debugFlush, debugPrint, formatNodeString, getBeginOffset, getDebugOutput, getEndOffset, getNodeFactory, getNodeType, getNullNode, getParserContext, getStatementType, getUserData, init, init, init, init, init, init, init, init, init, init, init, init, init, isInstanceOf, makeTableName, makeTableName, nodeHeader, printLabel, printSubNodes, setBeginOffset, setDebugOutput, setEndOffset, setNodeType, setParserContext, setUserData, stackPrint, treePrint, treePrint, treePrint
public void init(java.lang.Object typeId, java.lang.Object precision, java.lang.Object scale, java.lang.Object isNullable, java.lang.Object maximumWidth) throws StandardException
init
in class QueryTreeNode
typeId
- The TypeID of this new nodeprecision
- The precision of this new nodescale
- The scale of this new nodeisNullable
- The nullability of this new nodemaximumWidth
- The maximum width of this new nodeStandardException
public void copyFrom(QueryTreeNode node) throws StandardException
copyFrom
in class QueryTreeNode
StandardException
public java.lang.String toString()
toString
in class QueryTreeNode
public DataTypeDescriptor getType()
public void setNullability(boolean nullability) throws StandardException
StandardException
public TypeId getTypeId() throws StandardException
StandardException
public void setType(DataTypeDescriptor type) throws StandardException
type
- The DataTypeDescriptor to set in this ValueNodeStandardException
public ResultColumn getSourceResultColumn()
public java.lang.String getSchemaName() throws StandardException
StandardException
public java.lang.String getTableName()
public java.lang.String getColumnName()
public boolean isConstantExpression()
public boolean isBooleanTrue()
public boolean isBooleanFalse()
public boolean isRelationalOperator()
RelationalOperator
,
BinaryRelationalOperatorNode
,
IsNullNode
public boolean isBinaryEqualsOperatorNode()
isRelationalOperator()
public boolean isInListProbeNode()
public boolean isParameterNode()
protected abstract boolean isEquivalent(ValueNode other) throws StandardException
This method provides basic expression matching facility for the derived class of ValueNode and it is used by the language layer to compare the node structural form of the two expressions for equivalence at bind phase.
Note that it is not comparing the actual row values at runtime to produce a result; hence, when comparing SQL NULLs, they are considered to be equivalent and not unknown.
One usage case of this method in this context is to compare the select column expression against the group by expression to check if they are equivalent. e.g.:
SELECT c1+c2 FROM t1 GROUP BY c1+c2
In general, node equivalence is determined by the derived class of ValueNode. But they generally abide to the rules below:
other
- the node to compare this ValueNode against.true
if the two nodes are equivalent,
false
otherwise.StandardException
protected final boolean isSameNodeType(ValueNode other)
QueryTreeNode.getNodeType()
.other
- the node to compare this value node against.true
if the two nodes are of the same type.Copyright © 2013. All Rights Reserved.