public class VirtualColumnNode extends ValueNode
| Modifier and Type | Field and Description |
|---|---|
(package private) int |
columnId |
private boolean |
correlated |
private ResultColumn |
sourceColumn |
private ResultSetNode |
sourceResultSet |
transformedAUTOINCREMENT_CREATE_MODIFY, AUTOINCREMENT_INC_INDEX, AUTOINCREMENT_IS_AUTOINCREMENT_INDEX, AUTOINCREMENT_START_INDEX| Constructor and Description |
|---|
VirtualColumnNode() |
| Modifier and Type | Method and Description |
|---|---|
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.
|
java.lang.String |
getSchemaName()
Get the name of the schema the ResultColumn's table is in, if any.
|
ResultColumn |
getSourceColumn()
Return the ResultColumn that is the source of this VirtualColumnNode.
|
ResultColumn |
getSourceResultColumn()
Return the ResultColumn that is the source of this VirtualColumnNode.
|
ResultSetNode |
getSourceResultSet()
Return the ResultSetNode that is the source of this VirtualColumnNode.
|
java.lang.String |
getTableName()
Get the name of the table the ResultColumn is in, if any.
|
DataTypeDescriptor |
getTypeServices()
Get the DataTypeServices from this Node.
|
void |
init(java.lang.Object sourceResultSet,
java.lang.Object sourceColumn,
java.lang.Object columnId)
Initializer for a VirtualColumnNode.
|
boolean |
isCloneable()
Return whether or not this expression tree is cloneable.
|
protected boolean |
isEquivalent(ValueNode o)
Tests if this node is equivalent to the specified ValueNode.
|
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, generateFilter, genIsNullTree, genSQLJavaSQLTree, getClone, getColumnName, getConstantValueAsObject, getDataValueFactory, getTablesReferenced, getTransformed, getTypeCompiler, getTypeId, init, isBinaryEqualsOperatorNode, isBooleanFalse, isBooleanTrue, isConstantExpression, isInListProbeNode, isParameterNode, isRelationalOperator, isSameNodeType, optimizableEqualityNode, preprocess, putAndsOnTop, remapColumnReferencesToExpressions, requiresTypeFromContext, selectivity, setCollationInfo, setCollationInfo, setCollationUsingCompilationSchema, setCollationUsingCompilationSchema, setNullability, setTransformed, setType, setType, toString, verifyChangeToCNF, verifyEliminateNots, verifyPutAndsOnTopaccept, acceptChildren, bindOffsetFetch, bindRowMultiSet, bindUserCatalogType, bindUserType, checkReliability, checkReliability, convertDefaultNode, createTypeDependency, debugFlush, debugPrint, disablePrivilegeCollection, formatNodeString, foundString, generateAuthorizeCheck, getBeginOffset, getClassFactory, getCompilerContext, getContextManager, getCursorInfo, getDataDictionary, getDependencyManager, getEndOffset, getExecutionFactory, getGenericConstantActionFactory, getIntProperty, getLanguageConnectionContext, getNodeFactory, getNodeType, getNullNode, getParameterTypes, getSchemaDescriptor, getSchemaDescriptor, getStatementType, getTableDescriptor, getTypeCompiler, init, init, init, init, init, init, init, init, init, init, init, init, isAtomic, isInstanceOf, isPrivilegeCollectionRequired, isSessionSchema, isSessionSchema, makeConstantAction, makeTableName, makeTableName, nodeHeader, orReliability, parseStatement, printLabel, referencesSessionSchema, resolveTableToSynonym, setBeginOffset, setContextManager, setEndOffset, setNodeType, setRefActionInfo, stackPrint, treePrint, treePrint, verifyClassExistprivate ResultSetNode sourceResultSet
private ResultColumn sourceColumn
int columnId
private boolean correlated
public void init(java.lang.Object sourceResultSet,
java.lang.Object sourceColumn,
java.lang.Object columnId)
throws StandardException
init in interface Nodeinit in class QueryTreeNodesourceResultSet - The ResultSetNode where the value is originatingsourceColumn - The ResultColumn where the value is originatingcolumnId - The columnId within the current RowStandardException - Thrown on errorpublic void printSubNodes(int depth)
printSubNodes in class QueryTreeNodedepth - The depth of this node in the treepublic ResultSetNode getSourceResultSet()
public ResultColumn getSourceColumn()
public java.lang.String getTableName()
getTableName in class ValueNodepublic java.lang.String getSchemaName()
throws StandardException
getSchemaName in class ValueNodeStandardExceptionpublic boolean updatableByCursor()
updatableByCursor in class ValueNodepublic ResultColumn getSourceResultColumn()
getSourceResultColumn in class ValueNodevoid setCorrelated()
boolean getCorrelated()
public boolean isCloneable()
isCloneable in class ValueNodepublic void generateExpression(ExpressionClassBuilder acb, MethodBuilder mb) throws StandardException
generateExpression in class ValueNodeacb - The ExpressionClassBuilder for the class being builtmb - The method the expression will go intoStandardException - Thrown on errorprotected int getOrderableVariantType()
throws StandardException
getOrderableVariantType in class ValueNodeStandardException - thrown on errorpublic DataTypeDescriptor getTypeServices()
getTypeServices in class ValueNodepublic void setType(DataTypeDescriptor dtd) throws StandardException
ValueNodesetType in class ValueNodedtd - The DataTypeServices to set in this
ValueNodeStandardExceptionprotected boolean isEquivalent(ValueNode o) throws StandardException
ValueNodeThis 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 ValueNodeo - the node to compare this ValueNode against.true if the two nodes are equivalent,
false otherwise.StandardExceptionApache Derby V10.10 Internals - Copyright © 2004,2014 The Apache Software Foundation. All Rights Reserved.