class VirtualColumnNode extends ValueNode
Modifier and Type | Field and Description |
---|---|
(package private) int |
columnId |
private boolean |
correlated |
private ResultColumn |
sourceColumn |
private ResultSetNode |
sourceResultSet |
transformed
AUTOINCREMENT_CREATE_MODIFY, AUTOINCREMENT_CYCLE, AUTOINCREMENT_INC_INDEX, AUTOINCREMENT_IS_AUTOINCREMENT_INDEX, AUTOINCREMENT_START_INDEX
Constructor and Description |
---|
VirtualColumnNode(ResultSetNode sourceResultSet,
ResultColumn sourceColumn,
int columnId,
ContextManager cm)
Constructor for a VirtualColumnNode.
|
Modifier and Type | Method and Description |
---|---|
(package private) void |
generateExpression(ExpressionClassBuilder acb,
MethodBuilder mb)
ColumnNode's are against the current row in the system.
|
(package private) boolean |
getCorrelated()
Return whether or not this VCN is a correlated reference.
|
protected int |
getOrderableVariantType()
Return the variant type for the underlying expression.
|
(package private) java.lang.String |
getSchemaName()
Get the name of the schema the ResultColumn's table is in, if any.
|
(package private) ResultColumn |
getSourceColumn()
Return the ResultColumn that is the source of this VirtualColumnNode.
|
(package private) ResultColumn |
getSourceResultColumn()
Return the ResultColumn that is the source of this VirtualColumnNode.
|
(package private) ResultSetNode |
getSourceResultSet()
Return the ResultSetNode that is the source of this VirtualColumnNode.
|
(package private) java.lang.String |
getTableName()
Get the name of the table the ResultColumn is in, if any.
|
DataTypeDescriptor |
getTypeServices()
Get the DataTypeServices from this Node.
|
(package private) boolean |
isCloneable()
Return whether or not this expression tree is cloneable.
|
(package private) boolean |
isEquivalent(ValueNode o)
Tests if this node is equivalent to the specified ValueNode.
|
(package private) void |
printSubNodes(int depth)
Prints the sub-nodes of this object.
|
(package private) void |
setCorrelated()
Mark this VCN as a reference to a correlated column.
|
void |
setType(DataTypeDescriptor dtd)
Set the DataTypeServices for this ValueNode.
|
boolean |
updatableByCursor()
Return whether or not the ResultColumn is wirtable by a positioned update.
|
bindExpression, bindExpression, categorize, changeToCNF, checkIsBoolean, checkTopPredicatesForEqualsConditions, constantExpression, copyFields, eliminateNots, evaluateConstantExpressions, genEqualsFalseTree, generate, genIsNullTree, genSQLJavaSQLTree, getClone, getColumnName, getConstantValueAsObject, getDataValueFactory, getTablesReferenced, getTransformed, getTypeCompiler, getTypeId, isBinaryEqualsOperatorNode, isBooleanFalse, isBooleanTrue, isConstantExpression, isInListProbeNode, isParameterNode, isRelationalOperator, isSameNodeKind, optimizableEqualityNode, preprocess, putAndsOnTop, remapColumnReferencesToExpressions, requiresTypeFromContext, selectivity, setCollationInfo, setCollationInfo, setCollationUsingCompilationSchema, setCollationUsingCompilationSchema, setNullability, setTransformed, setType, setType, toString, verifyChangeToCNF, verifyEliminateNots, verifyPutAndsOnTop
accept, acceptChildren, addTag, addUDTUsagePriv, addUDTUsagePriv, bindOffsetFetch, bindRowMultiSet, bindUserCatalogType, bindUserType, checkReliability, checkReliability, convertDefaultNode, copyTagsFrom, createTypeDependency, debugFlush, debugPrint, disablePrivilegeCollection, formatNodeString, generateAuthorizeCheck, getBeginOffset, getClassFactory, getCompilerContext, getContext, getContextManager, getDataDictionary, getDependencyManager, getEndOffset, getExecutionFactory, getGenericConstantActionFactory, getIntProperty, getLanguageConnectionContext, getLongProperty, getNullNode, getOffsetOrderedNodes, getOptimizerFactory, getOptimizerTracer, getParameterTypes, getSchemaDescriptor, getSchemaDescriptor, getStatementType, getTableDescriptor, getTypeCompiler, getUDTDesc, isAtomic, isPrivilegeCollectionRequired, isSessionSchema, isSessionSchema, makeConstantAction, makeTableName, makeTableName, nodeHeader, optimizerTracingIsOn, orReliability, parseSearchCondition, parseStatement, printLabel, referencesSessionSchema, resolveTableToSynonym, setBeginOffset, setEndOffset, setRefActionInfo, stackPrint, taggedWith, treePrint, treePrint, verifyClassExist
private ResultSetNode sourceResultSet
private ResultColumn sourceColumn
int columnId
private boolean correlated
VirtualColumnNode(ResultSetNode sourceResultSet, ResultColumn sourceColumn, int columnId, ContextManager cm) throws StandardException
sourceResultSet
- The ResultSetNode where the value is originatingsourceColumn
- The ResultColumn where the value is originatingcolumnId
- The columnId within the current Rowcm
- The context managerStandardException
void printSubNodes(int depth)
printSubNodes
in class QueryTreeNode
depth
- The depth of this node in the treeResultSetNode getSourceResultSet()
ResultColumn getSourceColumn()
java.lang.String getTableName()
getTableName
in class ValueNode
java.lang.String getSchemaName() throws StandardException
getSchemaName
in class ValueNode
StandardException
public boolean updatableByCursor()
updatableByCursor
in class ValueNode
ResultColumn getSourceResultColumn()
getSourceResultColumn
in class ValueNode
void setCorrelated()
boolean getCorrelated()
boolean isCloneable()
isCloneable
in class ValueNode
void generateExpression(ExpressionClassBuilder acb, MethodBuilder mb) throws StandardException
generateExpression
in class ValueNode
acb
- The ExpressionClassBuilder for the class being builtmb
- The method the expression will go intoStandardException
- Thrown on errorprotected int getOrderableVariantType() throws StandardException
getOrderableVariantType
in class ValueNode
StandardException
- thrown on errorpublic final DataTypeDescriptor getTypeServices()
getTypeServices
in class ValueNode
public final void setType(DataTypeDescriptor dtd) throws StandardException
ValueNode
setType
in class ValueNode
dtd
- The DataTypeServices to set in this
ValueNodeStandardException
boolean isEquivalent(ValueNode o) throws StandardException
ValueNode
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:
isEquivalent
in class ValueNode
o
- the node to compare this ValueNode against.true
if the two nodes are equivalent,
false
otherwise.StandardException
Apache Derby V10.13 Internals - Copyright © 2004,2016 The Apache Software Foundation. All Rights Reserved.