|
||||||||||
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.TableOperatorNode
org.apache.derby.impl.sql.compile.SetOperatorNode
A SetOperatorNode represents a UNION, INTERSECT, or EXCEPT in a DML statement. Binding and optimization preprocessing is the same for all of these operations, so they share bind methods in this abstract class. The class contains a boolean telling whether the operation should eliminate duplicate rows.
Field Summary | |
(package private) boolean |
all
Tells whether to eliminate duplicate rows. |
(package private) OrderByList |
orderByList
|
Fields inherited from class org.apache.derby.impl.sql.compile.TableOperatorNode |
leftOptimizer, leftResultSet, nestedInParens, rightOptimizer, rightResultSet |
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 | |
SetOperatorNode()
|
Method Summary | |
void |
bindResultColumns(FromList fromListParam)
Bind the result columns of this ResultSetNode when there is no base table to bind them to. |
void |
bindResultColumns(TableDescriptor targetTableDescriptor,
FromVTI targetVTI,
ResultColumnList targetColumnList,
DMLStatementNode statement,
FromList fromListParam)
Bind the result columns for this ResultSetNode to a base table. |
void |
bindTargetExpressions(FromList fromListParam)
Bind the expressions in the target list. |
void |
bindUntypedNullsToResultColumns(ResultColumnList rcl)
Bind the result columns of a table constructor to the types in the given ResultColumnList. |
private void |
buildRCL()
Build the RCL for this node. |
ResultSetNode |
enhanceRCLForInsert(int numTargetColumns,
int[] colMap,
DataDictionary dataDictionary,
TableDescriptor targetTD,
FromVTI targetVTI)
This ResultSet is the source for an Insert. |
ResultSetNode |
ensurePredicateList(int numTables)
Ensure that the top of the RSN tree has a PredicateList. |
boolean |
flattenableInFromSubquery(FromList fromList)
Evaluate whether or not the subquery in a FromSubquery is flattenable. |
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. |
(package private) abstract java.lang.String |
getOperatorName()
|
(package private) int |
getParamColumnTypes(DataTypeDescriptor[] types,
RowResultSetNode rrsn)
Get the parameter types from the given RowResultSetNode into the given array of types. |
void |
init(java.lang.Object leftResult,
java.lang.Object rightResult,
java.lang.Object all,
java.lang.Object tableProperties)
Initializer for a SetOperatorNode. |
boolean |
performMaterialization(JBitSet outerTables)
Return whether or not to materialize this ResultSet tree. |
ResultSetNode |
preprocess(int numTables,
GroupByList gbl,
FromList fromList)
Put a ProjectRestrictNode on top of each FromTable in the FromList. |
(package private) void |
pushOrderByList(OrderByList orderByList)
Push the order by list down from the cursor node into its child result set so that the optimizer has all of the information that it needs to consider sort avoidance. |
(package private) void |
setParamColumnTypes(DataTypeDescriptor[] types,
RowResultSetNode rrsn)
Set the type of each ? |
void |
setResultToBooleanTrueNode(boolean onlyConvertAlls)
Set the result column for the subquery to a boolean true, Useful for transformations such as changing: where exists (select ... from ...) |
java.lang.String |
toString()
Convert this object to a String. |
void |
verifySelectStarSubquery(FromList outerFromList,
int subqueryType)
Verify that a SELECT * is valid for this type of subquery. |
Methods inherited from class org.apache.derby.impl.sql.compile.TableOperatorNode |
accept, bindExpressions, bindExpressionsWithTables, bindNonVTITables, bindVTITables, decrementLevel, getExposedName, getLeftmostResultSet, getLeftResultSet, getNestedInParens, getRightResultSet, init, markOrderingDependent, modifyAccessPath, modifyAccessPaths, needsSpecialRCLBinding, optimize, optimizeSource, printSubNodes, projectResultColumns, referencesSessionSchema, referencesTarget, rejectParameters, replaceDefaults, setLeftmostResultSet, setLevel, setNestedInParens, setReferencedColumns, verifyProperties |
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 all
OrderByList orderByList
Constructor Detail |
public SetOperatorNode()
Method Detail |
public void init(java.lang.Object leftResult, java.lang.Object rightResult, java.lang.Object all, java.lang.Object tableProperties) throws StandardException
init
in class QueryTreeNode
leftResult
- The ResultSetNode on the left side of this unionrightResult
- The ResultSetNode on the right side of this unionall
- Whether or not this is an ALL.tableProperties
- Properties list associated with the table
StandardException
- Thrown on errorpublic java.lang.String toString()
toString
in class TableOperatorNode
public void bindResultColumns(FromList fromListParam) throws StandardException
bindResultColumns
in class TableOperatorNode
fromListParam
- FromList to use/append to.
StandardException
- Thrown on errorpublic void bindResultColumns(TableDescriptor targetTableDescriptor, FromVTI targetVTI, ResultColumnList targetColumnList, DMLStatementNode statement, FromList fromListParam) throws StandardException
bindResultColumns
in class TableOperatorNode
targetTableDescriptor
- The TableDescriptor for the table being
updated or inserted intotargetColumnList
- For INSERT statements, the user
does not have to supply column
names (for example, "insert into t
values (1,2,3)". When this
parameter is null, it means that
the user did not supply column
names, and so the binding should
be done based on order. When it
is not null, it means do the binding
by name, not position.statement
- Calling DMLStatementNode (Insert or Update)fromListParam
- FromList to use/append to.
StandardException
- Thrown on errorprivate void buildRCL() throws StandardException
StandardException
- Thrown on errorpublic void bindUntypedNullsToResultColumns(ResultColumnList rcl) throws StandardException
bindUntypedNullsToResultColumns
in class ResultSetNode
rcl
- The ResultColumnList with the types to bind to
StandardException
- Thrown on error.int getParamColumnTypes(DataTypeDescriptor[] types, RowResultSetNode rrsn)
types
- The array of types to fill inrrsn
- The RowResultSetNode from which to take the param types
void setParamColumnTypes(DataTypeDescriptor[] types, RowResultSetNode rrsn) throws StandardException
types
- An array of types containing the proper type for each
? parameter, by ordinal position.rrsn
- A RowResultSetNode that could contain ? parameters whose
types need to be set.
StandardException
- Thrown on errorpublic void bindTargetExpressions(FromList fromListParam) throws StandardException
bindTargetExpressions
in class ResultSetNode
StandardException
- Thrown on errorvoid pushOrderByList(OrderByList orderByList)
pushOrderByList
in class ResultSetNode
orderByList
- The order by list
public ResultSetNode preprocess(int numTables, GroupByList gbl, FromList fromList) throws StandardException
preprocess
in class TableOperatorNode
numTables
- Number of tables in the DML Statementgbl
- The group by list, if anyfromList
- The from list, if any
StandardException
- Thrown on errorpublic ResultSetNode ensurePredicateList(int numTables) throws StandardException
ensurePredicateList
in class ResultSetNode
numTables
- The number of tables in the query.
StandardException
- Thrown on errorpublic void verifySelectStarSubquery(FromList outerFromList, int subqueryType) throws StandardException
verifySelectStarSubquery
in class ResultSetNode
outerFromList
- The FromList from the outer query block(s)subqueryType
- The subquery type
StandardException
- Thrown on errorprotected FromTable getFromTableByName(java.lang.String name, java.lang.String schemaName, boolean exactMatch) throws StandardException
getFromTableByName
in class TableOperatorNode
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 errorpublic void setResultToBooleanTrueNode(boolean onlyConvertAlls) throws StandardException
setResultToBooleanTrueNode
in class ResultSetNode
onlyConvertAlls
- Boolean, whether or not to just convert *'s
StandardException
- Thrown on errorpublic ResultSetNode enhanceRCLForInsert(int numTargetColumns, int[] colMap, DataDictionary dataDictionary, TableDescriptor targetTD, FromVTI targetVTI) throws StandardException
enhanceRCLForInsert
in class ResultSetNode
numTargetColumns
- # of columns in target RCLdataDictionary
- DataDictionary to usetargetTD
- TableDescriptor for target if the target is not a VTI, null if a VTItargetVTI
- Target description if it is a VTI, null if not a VTI
StandardException
- Thrown on errorpublic boolean flattenableInFromSubquery(FromList fromList)
flattenableInFromSubquery
in class ResultSetNode
fromList
- The outer from list
public boolean performMaterialization(JBitSet outerTables) throws StandardException
performMaterialization
in class ResultSetNode
StandardException
- Thrown on errorabstract java.lang.String getOperatorName()
|
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 |