|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.derby.impl.sql.compile.QueryTreeNode
org.apache.derby.impl.sql.compile.ResultSetNode
org.apache.derby.impl.sql.compile.FromTable
org.apache.derby.impl.sql.compile.FromSubquery
A FromSubquery represents a subquery in the FROM list of a DML statement. The current implementation of this class is only sufficient for Insert's need to push a new select on top of the one the user specified, to make the selected structure match that of the insert target table.
| Field Summary | |
(package private) boolean |
generatedForGroupByClause
|
(package private) boolean |
generatedForHavingClause
|
(package private) ResultSetNode |
subquery
|
| Fields inherited from class org.apache.derby.impl.sql.compile.FromTable |
bestAccessPath, bestCostEstimate, bestSortAvoidancePath, correlationName, corrTableName, currentAccessPath, hashKeyColumns, initialCapacity, level, loadFactor, maxCapacity, tableNumber, tableProperties, trulyTheBestAccessPath, userSpecifiedJoinStrategy |
| Fields inherited from class org.apache.derby.impl.sql.compile.ResultSetNode |
costEstimate, cursorTargetTable, insertSource, optimizer, referencedTableMap, resultColumns, resultSetNumber, scratchCostEstimate, statementResultSet |
| Fields inherited from class org.apache.derby.impl.sql.compile.QueryTreeNode |
AUTOINCREMENT_INC_INDEX, AUTOINCREMENT_IS_AUTOINCREMENT_INDEX, AUTOINCREMENT_START_INDEX, beginOffset, endOffset |
| Constructor Summary | |
FromSubquery()
|
|
| Method Summary | |
void |
bindExpressions(FromList fromListParam)
Bind the expressions in this FromSubquery. |
ResultSetNode |
bindNonVTITables(DataDictionary dataDictionary,
FromList fromListParam)
Bind this subquery that appears in the FROM list. |
void |
bindUntypedNullsToResultColumns(ResultColumnList bindingRCL)
Bind any untyped null nodes to the types in the given ResultColumnList. |
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. |
ResultSetNode |
extractSubquery(int numTables)
Extract out and return the subquery, with a PRN on top. |
FromList |
flatten(ResultColumnList rcl,
PredicateList outerPList,
SubqueryList sql,
GroupByList gbl)
Flatten this FSqry into the outer query block. |
ResultColumnList |
getAllResultColumns(TableName allTableName)
Expand a "*" into a ResultColumnList with all of the result columns from the subquery. |
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. |
protected 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. |
ResultColumn |
getMatchingColumn(ColumnReference columnReference)
Try to find a ResultColumn in the table represented by this FromBaseTable that matches the name in the given ColumnReference. |
ResultSetNode |
getSubquery()
Return the "subquery" from this node. |
void |
init(java.lang.Object subquery,
java.lang.Object correlationName,
java.lang.Object derivedRCL,
java.lang.Object tableProperties)
Intializer for a table in a FROM list. |
void |
markAsForGroupByClause()
Mark this FromSubquery as being generated for a GROUP BY clause. |
void |
markAsForHavingClause()
Mark this FromSubquery as being generated for a HAVING clause. |
ResultSetNode |
preprocess(int numTables,
GroupByList gbl,
FromList fromList)
Preprocess a ResultSetNode - this currently means: o Generating a referenced table map for each ResultSetNode. |
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) |
boolean |
referencesTarget(java.lang.String name,
boolean baseTable)
Search to see if a query references the specifed table name. |
void |
rejectParameters()
Check for (and reject) ? |
java.lang.String |
toString()
Convert this object to a String. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.apache.derby.iapi.sql.compile.Optimizable |
getDataDictionary, getReferencedTableMap, getResultSetNumber |
| Field Detail |
boolean generatedForGroupByClause
boolean generatedForHavingClause
ResultSetNode subquery
| Constructor Detail |
public FromSubquery()
| Method Detail |
public void init(java.lang.Object subquery,
java.lang.Object correlationName,
java.lang.Object derivedRCL,
java.lang.Object tableProperties)
init in class QueryTreeNodecorrelationName - The correlation namederivedRCL - The derived column listtableProperties - Properties list associated with the tablepublic java.lang.String toString()
toString in class FromTablepublic void printSubNodes(int depth)
printSubNodes in class ResultSetNodedepth - The depth of this node in the tree
public ResultSetNode getSubquery()
public void markAsForGroupByClause()
public void markAsForHavingClause()
protected FromTable getFromTableByName(java.lang.String name,
java.lang.String schemaName,
boolean exactMatch)
throws StandardException
getFromTableByName in class FromTablename - 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 error
public ResultSetNode bindNonVTITables(DataDictionary dataDictionary,
FromList fromListParam)
throws StandardException
bindNonVTITables in class ResultSetNodedataDictionary - The DataDictionary to use for bindingfromListParam - FromList to use/append to.
StandardException - Thrown on error
public ResultSetNode bindVTITables(FromList fromListParam)
throws StandardException
bindVTITables in class ResultSetNodefromListParam - FromList to use/append to.
StandardException - Thrown on error
public void rejectParameters()
throws StandardException
rejectParameters in class ResultSetNodeStandardException - Thrown if a ? parameter found
directly under a ResultColumn
public void bindExpressions(FromList fromListParam)
throws StandardException
bindExpressions in class ResultSetNodefromListParam - FromList to use/append to.
StandardException - Thrown on error
public ResultColumn getMatchingColumn(ColumnReference columnReference)
throws StandardException
getMatchingColumn in class ResultSetNodecolumnReference - The columnReference whose name we're looking
for in the given table.
StandardException - Thrown on error
public ResultSetNode preprocess(int numTables,
GroupByList gbl,
FromList fromList)
throws StandardException
preprocess in class ResultSetNodenumTables - The number of tables in the DML Statementgbl - The group by list, if anyfromList - The from list, if any
StandardException - Thrown on error
public ResultSetNode extractSubquery(int numTables)
throws StandardException
numTables - The number of tables in the DML Statement
StandardException - Thrown on error
public FromList flatten(ResultColumnList rcl,
PredicateList outerPList,
SubqueryList sql,
GroupByList gbl)
throws StandardException
flatten in class FromTablercl - The RCL from the outer queryouterPList - PredicateList to append wherePredicates to.sql - The SubqueryList from the outer querygbl - The group by list, if any
StandardException - Thrown on errorpublic java.lang.String getExposedName()
getExposedName in class FromTable
public ResultColumnList getAllResultColumns(TableName allTableName)
throws StandardException
getAllResultColumns in class ResultSetNodeallTableName - The qualifier on the "*"
StandardException - Thrown on error
public boolean referencesTarget(java.lang.String name,
boolean baseTable)
throws StandardException
referencesTarget in class ResultSetNodename - Table name (String) to search for.baseTable - Whether or not name is for a base table
StandardException - Thrown on error
public boolean referencesSessionSchema()
throws StandardException
referencesSessionSchema in class QueryTreeNodeStandardException - Thrown on error
public void bindUntypedNullsToResultColumns(ResultColumnList bindingRCL)
throws StandardException
bindUntypedNullsToResultColumns in class ResultSetNodebindingRCL - The ResultColumnList with the types to bind to.
StandardException - Thrown on errorvoid decrementLevel(int decrement)
decrementLevel in class FromTabledecrement - The amount to decrement by.
|
Built on Tue 2006-10-10 19:23:47+0200, from revision exported | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||