class FromSubquery extends FromTable
ResultSetNode.QueryExpressionClauses
Modifier and Type | Field and Description |
---|---|
private ValueNode |
fetchFirst |
private boolean |
hasJDBClimitClause |
private ValueNode |
offset |
private OrderByList |
orderByList |
private SchemaDescriptor |
origCompilationSchema
DERBY-3270: If this subquery represents an expanded view, this holds the
current compilation schema at view definition time.
|
(package private) ResultSetNode |
subquery |
ADD_PLAN, bestAccessPath, bestCostEstimate, bestSortAvoidancePath, correlationName, corrTableName, currentAccessPath, hashKeyColumns, initialCapacity, level, LOAD_PLAN, loadFactor, maxCapacity, origTableName, REMOVE_PLAN, tableNumber, tableProperties, trulyTheBestAccessPath, userSpecifiedJoinStrategy
AUTOINCREMENT_CREATE_MODIFY, AUTOINCREMENT_CYCLE, AUTOINCREMENT_INC_INDEX, AUTOINCREMENT_IS_AUTOINCREMENT_INDEX, AUTOINCREMENT_START_INDEX
Constructor and Description |
---|
FromSubquery(ResultSetNode subquery,
OrderByList orderByList,
ValueNode offset,
ValueNode fetchFirst,
boolean hasJDBClimitClause,
java.lang.String correlationName,
ResultColumnList derivedRCL,
java.util.Properties tableProperties,
ContextManager cm)
Constructor for a table in a FROM list.
|
Modifier and Type | Method and Description |
---|---|
(package private) void |
acceptChildren(Visitor v)
Accept the visitor for all visitable children of this node.
|
(package private) void |
bindExpressions(FromList fromListParam)
Bind the expressions in this FromSubquery.
|
(package private) ResultSetNode |
bindNonVTITables(DataDictionary dataDictionary,
FromList fromListParam)
Bind this subquery that appears in the FROM list.
|
(package private) void |
bindUntypedNullsToResultColumns(ResultColumnList bindingRCL)
Bind any untyped null nodes to the types in the given ResultColumnList.
|
(package private) ResultSetNode |
bindVTITables(FromList fromListParam)
Bind this subquery that appears in the FROM list.
|
(package private) void |
decrementLevel(int decrement)
Decrement (query block) level (0-based) for this FromTable.
|
(package private) ResultSetNode |
extractSubquery(int numTables)
Extract out and return the subquery, with a PRN on top.
|
(package private) FromList |
flatten(ResultColumnList rcl,
PredicateList outerPList,
SubqueryList sql,
GroupByList gbl,
ValueNode havingClause)
Flatten this FSqry into the outer query block.
|
(package private) ResultColumnList |
getAllResultColumns(TableName allTableName)
Expand a "*" into a ResultColumnList with all of the
result columns from the subquery.
|
(package private) java.lang.String |
getExposedName()
Get the exposed name for this table, which is the name that can
be used to refer to it in the rest of the query.
|
(package private) FromTable |
getFromTableByName(java.lang.String name,
java.lang.String schemaName,
boolean exactMatch)
Determine whether or not the specified name is an exposed name in
the current query block.
|
(package private) ResultColumn |
getMatchingColumn(ColumnReference columnReference)
Try to find a ResultColumn in the table represented by this FromBaseTable
that matches the name in the given ColumnReference.
|
(package private) ResultSetNode |
getSubquery()
Return the "subquery" from this node.
|
(package private) ResultSetNode |
preprocess(int numTables,
GroupByList gbl,
FromList fromList)
Preprocess a ResultSetNode - this currently means:
o Generating a referenced table map for each ResultSetNode.
|
(package private) void |
printSubNodes(int depth)
Prints the sub-nodes of this object.
|
boolean |
referencesSessionSchema()
Return true if the node references SESSION schema tables (temporary or permanent)
|
(package private) boolean |
referencesTarget(java.lang.String name,
boolean baseTable)
Search to see if a query references the specifed table name.
|
(package private) void |
rejectParameters()
Check for (and reject) ?
|
(package private) void |
setOrigCompilationSchema(SchemaDescriptor sd)
Associate this subquery with the original compilation schema of a view.
|
assignCostEstimate, canBeOrdered, columnsAreUpdatable, considerSortAvoidancePath, convertAbsoluteToRelativeColumnPosition, cursorTargetTable, estimateCost, feasibleJoinStrategy, fillInReferencedTableMap, forUpdate, getBaseTableName, getBestAccessPath, getBestSortAvoidancePath, getCorrelationName, getCostEstimate, getCurrentAccessPath, getFinalCostEstimate, getLevel, getMergeTableID, getName, getNumColumnsReturned, getOrigTableName, getProperties, getResultColumnsForList, getSchemaDescriptor, getSchemaDescriptor, getScratchCostEstimate, getTableDescriptor, getTableName, getTableNumber, getTrulyTheBestAccessPath, getUserSpecifiedJoinStrategy, hashKeyColumns, hasLargeObjectColumns, hasTableNumber, initAccessPaths, initialCapacity, isBaseTable, isCoveringIndex, isFlattenableJoinNode, isJoinColumnForRightOuterJoin, isMaterializable, isOneRowScan, isTargetTable, legalJoinOrder, loadFactor, LOJ_reorderable, markUpdatableByCursor, maxCapacity, memoryUsageOK, modifyAccessPath, needsSpecialRCLBinding, nextAccessPath, optimizeIt, optimizeSubqueries, pullOptPredicates, pushExpressions, pushOptPredicate, rememberAsBest, rememberJoinStrategyAsBest, rememberSortAvoidancePath, resetJoinStrategies, setCostEstimateCost, setHashKeyColumns, setLevel, setMergeTableID, setOrigTableName, setProperties, setTableNumber, startOptimizing, supportsMultipleInstantiations, tellRowOrderingAboutConstantColumns, toString, transformOuterJoins, uniqueJoin, updateBestPlanMap, verifyProperties
addNewPredicate, adjustForSortElimination, adjustForSortElimination, assignResultSetNumber, bindExpressionsWithTables, bindResultColumns, bindResultColumns, bindTargetExpressions, changeAccessPath, columnTypesAndLengthsMatch, considerMaterialization, enhanceRCLForInsert, ensurePredicateList, flattenableInFromSubquery, generateNormalizationResultSet, generateResultSet, genProjectRestrict, genProjectRestrict, genProjectRestrictForReordering, getCandidateFinalCostEstimate, getCostEstimate, getCursorTargetTable, getFromList, getNewCostEstimate, getOptimizer, getOptimizerImpl, getRCLForInsert, getReferencedTableMap, getResultColumns, getResultSetNumber, getScratchCostEstimate, isCursorTargetTable, isInsertSource, isNotExists, isOneRowResultSet, isOrderedOn, isPossibleDistinctScan, isStatementResultSet, isUpdatableCursor, LOJgetReferencedTables, makeResultDescription, makeResultDescriptors, markAsCursorTargetTable, markForDistinctScan, markStatementResultSet, modifyAccessPaths, modifyAccessPaths, notCursorTargetTable, notFlattenableJoin, numDistinctAggregates, optimize, parseDefault, performMaterialization, printQueryExpressionSuffixClauses, projectResultColumns, pushOffsetFetchFirst, pushOrderByList, pushQueryExpressionSuffix, rejectXMLValues, renameGeneratedResultNames, replaceOrForbidDefaults, returnsAtMostOneRow, setCandidateFinalCostEstimate, setCostEstimate, setCursorTargetTable, setInsertSource, setOptimizer, setReferencedTableMap, setResultColumns, setResultSetNumber, setResultToBooleanTrueNode, setScratchCostEstimate, setTableConstructorTypes, subqueryReferencesTarget, updateTargetLockMode, verifySelectStarSubquery
accept, addTag, addUDTUsagePriv, addUDTUsagePriv, bindOffsetFetch, bindRowMultiSet, bindUserCatalogType, bindUserType, checkReliability, checkReliability, convertDefaultNode, copyTagsFrom, createTypeDependency, debugFlush, debugPrint, disablePrivilegeCollection, formatNodeString, generate, 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, resolveTableToSynonym, setBeginOffset, setEndOffset, setRefActionInfo, stackPrint, taggedWith, treePrint, treePrint, verifyClassExist
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getDataDictionary, getOptimizerTracer, getReferencedTableMap, getResultSetNumber, optimizerTracingIsOn
accept, addTag, taggedWith
ResultSetNode subquery
private OrderByList orderByList
private ValueNode offset
private ValueNode fetchFirst
private boolean hasJDBClimitClause
private SchemaDescriptor origCompilationSchema
FromSubquery(ResultSetNode subquery, OrderByList orderByList, ValueNode offset, ValueNode fetchFirst, boolean hasJDBClimitClause, java.lang.String correlationName, ResultColumnList derivedRCL, java.util.Properties tableProperties, ContextManager cm)
subquery
- The subqueryorderByList
- ORDER BY list if any, or nulloffset
- OFFSET if any, or nullfetchFirst
- FETCH FIRST if any, or nullhasJDBClimitClause
- True if the offset/fetchFirst clauses come
from JDBC limit/offset escape syntaxcorrelationName
- The correlation namederivedRCL
- The derived column listtableProperties
- Properties list associated with the tablecm
- The context managervoid printSubNodes(int depth)
printSubNodes
in class ResultSetNode
depth
- The depth of this node in the treeResultSetNode getSubquery()
FromTable getFromTableByName(java.lang.String name, java.lang.String schemaName, boolean exactMatch) throws StandardException
getFromTableByName
in class FromTable
name
- The specified name to search for as an exposed name.schemaName
- Schema name, if non-null.exactMatch
- Whether or not we need an exact match on specified schema and table
names or match on table id.StandardException
- Thrown on errorResultSetNode bindNonVTITables(DataDictionary dataDictionary, FromList fromListParam) throws StandardException
bindNonVTITables
in class ResultSetNode
dataDictionary
- The DataDictionary to use for bindingfromListParam
- FromList to use/append to.StandardException
- Thrown on errorResultSetNode bindVTITables(FromList fromListParam) throws StandardException
bindVTITables
in class ResultSetNode
fromListParam
- FromList to use/append to.StandardException
- Thrown on errorvoid rejectParameters() throws StandardException
rejectParameters
in class ResultSetNode
StandardException
- Thrown if a ? parameter found
directly under a ResultColumnvoid bindExpressions(FromList fromListParam) throws StandardException
bindExpressions
in class ResultSetNode
fromListParam
- FromList to use/append to.StandardException
- Thrown on errorResultColumn getMatchingColumn(ColumnReference columnReference) throws StandardException
getMatchingColumn
in class ResultSetNode
columnReference
- The columnReference whose name we're looking
for in the given table.StandardException
- Thrown on errorResultSetNode preprocess(int numTables, GroupByList gbl, FromList fromList) throws StandardException
preprocess
in class ResultSetNode
numTables
- The number of tables in the DML Statementgbl
- The group by list, if anyfromList
- The from list, if anyStandardException
- Thrown on errorResultSetNode extractSubquery(int numTables) throws StandardException
numTables
- The number of tables in the DML StatementStandardException
- Thrown on errorFromList flatten(ResultColumnList rcl, PredicateList outerPList, SubqueryList sql, GroupByList gbl, ValueNode havingClause) throws StandardException
flatten
in class FromTable
rcl
- The RCL from the outer queryouterPList
- PredicateList to append wherePredicates to.sql
- The SubqueryList from the outer querygbl
- The group by list, if anyhavingClause
- The HAVING clause, if anyStandardException
- Thrown on errorjava.lang.String getExposedName()
getExposedName
in class FromTable
ResultColumnList getAllResultColumns(TableName allTableName) throws StandardException
getAllResultColumns
in class ResultSetNode
allTableName
- The qualifier on the "*"null
if
allTableName
is non-null and doesn't match a table name in
this result setStandardException
- Thrown on errorboolean referencesTarget(java.lang.String name, boolean baseTable) throws StandardException
referencesTarget
in class ResultSetNode
name
- Table name (String) to search for.baseTable
- Whether or not name is for a base tableStandardException
- Thrown on errorpublic boolean referencesSessionSchema() throws StandardException
referencesSessionSchema
in class QueryTreeNode
StandardException
- Thrown on errorvoid bindUntypedNullsToResultColumns(ResultColumnList bindingRCL) throws StandardException
bindUntypedNullsToResultColumns
in class ResultSetNode
bindingRCL
- The ResultColumnList with the types to bind to.StandardException
- Thrown on errorvoid decrementLevel(int decrement)
decrementLevel
in class FromTable
decrement
- The amount to decrement by.void setOrigCompilationSchema(SchemaDescriptor sd)
sd
- schema descriptor of the original compilation schema of the
view.void acceptChildren(Visitor v) throws StandardException
ResultSetNode
acceptChildren
in class FromTable
v
- the visitorStandardException
- on errorQueryTreeNode.acceptChildren(org.apache.derby.iapi.sql.compile.Visitor)
Apache Derby V10.13 Internals - Copyright © 2004,2016 The Apache Software Foundation. All Rights Reserved.