| Modifier and Type | Field and Description |
|---|---|
| private ValueNode | |
| private boolean | |
| private ValueNode | |
| private OrderByList | |
| private SchemaDescriptor | origCompilationSchema
DERBY-3270: If this subquery represents an expanded view, this holds the current compilation schema at view definition time. |
| pack-priv ResultSetNode |
| Access | Constructor and Description |
|---|---|
| pack-priv | FromSubquery(ResultSetNode
The subquery subquery, OrderByList ORDER BY list if any, or null orderByList, ValueNode OFFSET if any, or null offset, ValueNode FETCH FIRST if any, or null fetchFirst, boolean True if the offset/fetchFirst clauses come
from JDBC limit/offset escape syntax hasJDBClimitClause, String The correlation name correlationName, ResultColumnList The derived column list derivedRCL, Properties Properties list associated with the table tableProperties, ContextManager The context manager cm)Constructor for a table in a FROM list. |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv void | acceptChildren(Visitor
the visitor v)Overrides org. Accept the visitor for all visitable children of this node. |
| pack-priv void | bindExpressions(FromList
FromList to use/append to. fromListParam)Overrides org. Bind the expressions in this FromSubquery. |
| pack-priv ResultSetNode | Returns: ResultSetNode The bound FromSubquery.The DataDictionary to use for binding dataDictionary, FromList FromList to use/append to. fromListParam)Overrides org. Bind this subquery that appears in the FROM list. |
| pack-priv void | bindUntypedNullsToResultColumns(ResultColumnList
The ResultColumnList with the types to bind to. bindingRCL)Overrides org. Bind any untyped null nodes to the types in the given ResultColumnList. |
| pack-priv ResultSetNode | Returns: ResultSetNode The bound FromSubquery.FromList to use/append to. fromListParam)Overrides org. Bind this subquery that appears in the FROM list. |
| pack-priv void | decrementLevel(int
The amount to decrement by. decrement)Overrides org. Decrement (query block) level (0-based) for this FromTable. |
| pack-priv ResultSetNode | Returns: ResultSetNode at top of extracted tree.The number of tables in the DML Statement numTables)Extract out and return the subquery, with a PRN on top. |
| pack-priv FromList | Returns: FromList The fromList from the underlying SelectNode.The RCL from the outer query rcl, PredicateList PredicateList to append wherePredicates to. outerPList, SubqueryList The SubqueryList from the outer query sql, GroupByList The group by list, if any gbl, ValueNode The HAVING clause, if any havingClause)Overrides org. Flatten this FSqry into the outer query block. |
| pack-priv ResultColumnList | getAllResultColumns(TableName
The qualifier on the "*" allTableName)Overrides org. Expand a "*" into a ResultColumnList with all of the result columns from the subquery. |
| pack-priv String | Returns: The exposed name for this table.Overrides org. 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. |
| pack-priv FromTable | Returns: The FromTable, if any, with the exposed name.The specified name to search for as an exposed name. name, String Schema name, if non-null. schemaName, boolean Whether or not we need an exact match on specified schema and table
names or match on table id. exactMatch)Overrides org. Determine whether or not the specified name is an exposed name in the current query block. |
| pack-priv ResultColumn | Returns: A ResultColumn whose expression is the ColumnNode that matches the ColumnReference. Returns null if there is no match.The columnReference whose name we're looking
for in the given table. columnReference)Overrides org. Try to find a ResultColumn in the table represented by this FromBaseTable that matches the name in the given ColumnReference. |
| pack-priv ResultSetNode | Returns: ResultSetNode The "subquery" from this node.Return the "subquery" from this node. |
| pack-priv ResultSetNode | Returns: ResultSetNode at top of preprocessed tree.The number of tables in the DML Statement numTables, GroupByList The group by list, if any gbl, FromList The from list, if any fromList)Overrides org. Preprocess a ResultSetNode - this currently means: o Generating a referenced table map for each ResultSetNode. |
| pack-priv void | printSubNodes(int
The depth of this node in the tree depth)Overrides org. Prints the sub-nodes of this object. |
| public boolean | Returns: true if references SESSION schema tables, else falseOverrides org. Return true if the node references SESSION schema tables (temporary or permanent) |
| pack-priv boolean | Returns: true if found, else falseTable name (String) to search for. name, boolean Whether or not name is for a base table baseTable)Overrides org. Search to see if a query references the specifed table name. |
| pack-priv void | rejectParameters()
Overrides org. Check for (and reject) ? |
| pack-priv void | setOrigCompilationSchema(SchemaDescriptor
schema descriptor of the original compilation schema of the
view. sd)Associate this subquery with the original compilation schema of a view. |
| fetchFirst | back to summary |
|---|---|
| private ValueNode fetchFirst | |
| hasJDBClimitClause | back to summary |
|---|---|
| private boolean hasJDBClimitClause | |
| offset | back to summary |
|---|---|
| private ValueNode offset | |
| orderByList | back to summary |
|---|---|
| private OrderByList orderByList | |
| origCompilationSchema | back to summary |
|---|---|
| private SchemaDescriptor origCompilationSchema DERBY-3270: If this subquery represents an expanded view, this holds the current compilation schema at view definition time. | |
| subquery | back to summary |
|---|---|
| pack-priv ResultSetNode subquery | |
| FromSubquery | back to summary |
|---|---|
| pack-priv FromSubquery(ResultSetNode subquery, OrderByList orderByList, ValueNode offset, ValueNode fetchFirst, boolean hasJDBClimitClause, String correlationName, ResultColumnList derivedRCL, Properties tableProperties, ContextManager cm) Constructor for a table in a FROM list.
| |
| acceptChildren | back to summary |
|---|---|
| pack-priv void acceptChildren(Visitor v) throws StandardException Overrides org. Doc from org. Accept the visitor for all visitable children of this node.
| |
| bindExpressions | back to summary |
|---|---|
| pack-priv void bindExpressions(FromList fromListParam) throws StandardException Overrides org. Bind the expressions in this FromSubquery. This means binding the sub-expressions, as well as figuring out what the return type is for each expression.
| |
| bindNonVTITables | back to summary |
|---|---|
| pack-priv ResultSetNode bindNonVTITables(DataDictionary dataDictionary, FromList fromListParam) throws StandardException Overrides org. Bind this subquery that appears in the FROM list.
| |
| bindUntypedNullsToResultColumns | back to summary |
|---|---|
| pack-priv void bindUntypedNullsToResultColumns(ResultColumnList bindingRCL) throws StandardException Overrides org. Bind any untyped null nodes to the types in the given ResultColumnList.
| |
| bindVTITables | back to summary |
|---|---|
| pack-priv ResultSetNode bindVTITables(FromList fromListParam) throws StandardException Overrides org. Bind this subquery that appears in the FROM list.
| |
| decrementLevel | back to summary |
|---|---|
| pack-priv void decrementLevel(int decrement) Overrides org. Decrement (query block) level (0-based) for this FromTable. This is useful when flattening a subquery.
| |
| extractSubquery | back to summary |
|---|---|
| pack-priv ResultSetNode extractSubquery(int numTables) throws StandardException Extract out and return the subquery, with a PRN on top. (See FromSubquery.preprocess() for more details.)
| |
| flatten | back to summary |
|---|---|
| pack-priv FromList flatten(ResultColumnList rcl, PredicateList outerPList, SubqueryList sql, GroupByList gbl, ValueNode havingClause) throws StandardException Overrides org. Flatten this FSqry into the outer query block. The steps in flattening are: o Mark all ResultColumns as redundant, so that they are "skipped over" at generate(). o Append the wherePredicates to the outer list. o Return the fromList so that the caller will merge the 2 lists RESOLVE - FSqrys with subqueries are currently not flattenable. Some of them can be flattened, however. We need to merge the subquery list when we relax this restriction. Note This method returns NULL when flattening RowResultSetNodes (the node for a VALUES clause). The reason is that no reference is left to the RowResultSetNode after flattening is done - the expressions point directly to the ValueNodes in the RowResultSetNode's ResultColumnList.
| |
| getAllResultColumns | back to summary |
|---|---|
| pack-priv ResultColumnList getAllResultColumns(TableName allTableName) throws StandardException Overrides org. Expand a "*" into a ResultColumnList with all of the result columns from the subquery.
| |
| getExposedName | back to summary |
|---|---|
| pack-priv String getExposedName() Overrides org. 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. | |
| getFromTableByName | back to summary |
|---|---|
| pack-priv FromTable getFromTableByName(String name, String schemaName, boolean exactMatch) throws StandardException Overrides org. Determine whether or not the specified name is an exposed name in the current query block.
| |
| getMatchingColumn | back to summary |
|---|---|
| pack-priv ResultColumn getMatchingColumn(ColumnReference columnReference) throws StandardException Overrides org. Try to find a ResultColumn in the table represented by this FromBaseTable that matches the name in the given ColumnReference.
| |
| getSubquery | back to summary |
|---|---|
| pack-priv ResultSetNode getSubquery() Return the "subquery" from this node.
| |
| preprocess | back to summary |
|---|---|
| pack-priv ResultSetNode preprocess(int numTables, GroupByList gbl, FromList fromList) throws StandardException Overrides org. Preprocess a ResultSetNode - this currently means: o Generating a referenced table map for each ResultSetNode. o Putting the WHERE and HAVING clauses in conjunctive normal form (CNF). o Converting the WHERE and HAVING clauses into PredicateLists and classifying them. o Ensuring that a ProjectRestrictNode is generated on top of every FromBaseTable and generated in place of every FromSubquery. o Pushing single table predicates down to the new ProjectRestrictNodes.
| |
| printSubNodes | back to summary |
|---|---|
| pack-priv void printSubNodes(int depth) Overrides org. Prints the sub-nodes of this object. See QueryTreeNode.java for how tree printing is supposed to work.
| |
| referencesSessionSchema | back to summary |
|---|---|
| public boolean referencesSessionSchema() throws StandardException Overrides org. Return true if the node references SESSION schema tables (temporary or permanent)
| |
| referencesTarget | back to summary |
|---|---|
| pack-priv boolean referencesTarget(String name, boolean baseTable) throws StandardException Overrides org. Search to see if a query references the specifed table name.
| |
| rejectParameters | back to summary |
|---|---|
| pack-priv void rejectParameters() throws StandardException Overrides org. Check for (and reject) ? parameters directly under the ResultColumns. This is done for SELECT statements. For FromSubquery, we simply pass the check through to the subquery.
| |
| setOrigCompilationSchema | back to summary |
|---|---|
| pack-priv void setOrigCompilationSchema(SchemaDescriptor sd) Associate this subquery with the original compilation schema of a view.
| |