| Modifier and Type | Field and Description |
|---|---|
| private boolean | |
| pack-priv boolean | |
| pack-priv boolean |
| Access | Constructor and Description |
|---|---|
| pack-priv | UnionNode(ResultSetNode
The ResultSetNode on the left side of this union leftResult, ResultSetNode The ResultSetNode on the right side of this union rightResult, boolean Whether or not this is a UNION ALL. all, boolean Whether or not this is from a table constructor. tableConstructor, Properties Properties list associated with the table tableProperties, ContextManager cm)Constructor for a UnionNode. |
| Modifier and Type | Method and Description |
|---|---|
| private ResultSetNode | Returns: (Potentially new) head of the ResultSetNode tree.Add any new ResultSetNodes that are necessary to the tree. |
| public void | bindExpressions(FromList
FromList to use/append to. fromListParam)Overrides org. Bind the expressions under this TableOperatorNode. |
| pack-priv ResultSetNode | enhanceRCLForInsert(InsertNode
the target node for the insert target, boolean are source cols in same order as target cols? inOrder, int[] int array representation of correspondence between
RCLs - colmap[i] = -1 -> missing in current RCL
colmap[i] = j -> targetRCL(i) <-> thisRCL(j+1) colMap)Overrides org. Make the RCL of this node match the target node for the insert. |
| pack-priv void | generate(ActivationClassBuilder
The ActivationClassBuilder for the class being built acb, MethodBuilder The method for the generated code to go into mb)Overrides org. Generate the code for this UnionNode. |
| pack-priv CostEstimate | Returns: The final CostEstimate for this UnionNode, which is the sum of the two child costs.Overrides org. Get the final CostEstimate for this FromTable. |
| pack-priv String | getOperatorName()
Implements abstract org.
|
| pack-priv void | |
| public Optimizable | modifyAccessPath(JBitSet
Bit map of the tables that are outer to this one
in the join order. outerTables)Overrides org. Implements org. Modify the access path for this Optimizable, as necessary. |
| pack-priv ResultSetNode | modifyAccessPaths()
Overrides org. Modify the access paths according to the decisions the optimizer made. |
| public CostEstimate | optimizeIt(Optimizer
Optimizer to use. optimizer, OptimizablePredicateList The predicate list to optimize against predList, CostEstimate The CostEstimate for the outer tables in the join order,
telling how many times this Optimizable will be scanned. outerCost, RowOrdering The row ordering for all the tables in the
join order, including this one. rowOrdering)Overrides org. Implements org. Choose the best access path for this Optimizable. |
| pack-priv void | pushExpressions(PredicateList
List of single table predicates to push predicateList)Overrides org. DERBY-649: Handle pushing predicates into UnionNodes. |
| pack-priv void | rejectParameters()
Overrides org. Check for (and reject) ? |
| pack-priv void | setTableConstructorTypes(ResultColumnList
The ResultColumnList containing the desired result
types. typeColumns)Overrides org. Set the type of column in the result column lists of each source of this union tree to the type in the given result column list (which represents the result columns for an insert). |
| pack-priv boolean | |
| public String | Returns: This object as a StringOverrides org. Convert this object to a String. |
| addNewNodesCalled | back to summary |
|---|---|
| private boolean addNewNodesCalled | |
| tableConstructor | back to summary |
|---|---|
| pack-priv boolean tableConstructor | |
| topTableConstructor | back to summary |
|---|---|
| pack-priv boolean topTableConstructor | |
| UnionNode | back to summary |
|---|---|
| pack-priv UnionNode(ResultSetNode leftResult, ResultSetNode rightResult, boolean all, boolean tableConstructor, Properties tableProperties, ContextManager cm) throws StandardException Constructor for a UnionNode.
| |
| addNewNodes | back to summary |
|---|---|
| private ResultSetNode addNewNodes() throws StandardException Add any new ResultSetNodes that are necessary to the tree. We wait until after optimization to do this in order to make it easier on the optimizer.
| |
| bindExpressions | back to summary |
|---|---|
| public void bindExpressions(FromList fromListParam) throws StandardException Overrides org. Bind the expressions under this TableOperatorNode. This means binding the sub-expressions, as well as figuring out what the return type is for each expression.
| |
| enhanceRCLForInsert | back to summary |
|---|---|
| pack-priv ResultSetNode enhanceRCLForInsert(InsertNode target, boolean inOrder, int[] colMap) throws StandardException Overrides org. Make the RCL of this node match the target node for the insert. If this node represents a table constructor (a VALUES clause), we replace the RCL with an enhanced one if necessary, and recursively enhance the RCL of each child node. For table constructors, we also need to check that we don't attempt to override auto-increment columns in each child node (checking the top-level RCL isn't sufficient since a table constructor may contain the DEFAULT keyword, which makes it possible to specify a column without overriding its value). If this node represents a regular UNION, put a ProjectRestrictNode on top of this node and enhance the RCL in that node.
| |
| generate | back to summary |
|---|---|
| pack-priv void generate(ActivationClassBuilder acb, MethodBuilder mb) throws StandardException Overrides org. Generate the code for this UnionNode.
| |
| getFinalCostEstimate | back to summary |
|---|---|
| pack-priv CostEstimate getFinalCostEstimate() throws StandardException Overrides org. Doc from org. Get the final CostEstimate for this FromTable.
| |
| getOperatorName | back to summary |
|---|---|
| pack-priv String getOperatorName() Implements abstract org.
| |
| markTopTableConstructor | back to summary |
|---|---|
| pack-priv void markTopTableConstructor() Mark this as the top node of a table constructor. | |
| modifyAccessPath | back to summary |
|---|---|
| public Optimizable modifyAccessPath(JBitSet outerTables) throws StandardException Overrides org. Implements org. Doc from org. Modify the access path for this Optimizable, as necessary. This includes things like adding a result set to translate from index rows to base rows
| |
| modifyAccessPaths | back to summary |
|---|---|
| pack-priv ResultSetNode modifyAccessPaths() throws StandardException Overrides org. Doc from org. Modify the access paths according to the decisions the optimizer made. This can include adding project/restrict nodes, index-to-base-row nodes, etc.
| |
| optimizeIt | back to summary |
|---|---|
| public CostEstimate optimizeIt(Optimizer optimizer, OptimizablePredicateList predList, CostEstimate outerCost, RowOrdering rowOrdering) throws StandardException Overrides org. Implements org. Doc from org. Choose the best access path for this Optimizable.
| |
| pushExpressions | back to summary |
|---|---|
| pack-priv void pushExpressions(PredicateList predicateList) throws StandardException Overrides org. DERBY-649: Handle pushing predicates into UnionNodes. It is possible to push
single table predicates that are binaryOperations or inListOperations.
Predicates of the form List of single table predicates to push
| |
| 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. Don't reject parameters that are in a table constructor - these are allowed, as long as the table constructor is in an INSERT statement or each column of the table constructor has at least one non-? column. The latter case is checked below, in bindExpressions().
| |
| setTableConstructorTypes | back to summary |
|---|---|
| pack-priv void setTableConstructorTypes(ResultColumnList typeColumns) throws StandardException Overrides org. Set the type of column in the result column lists of each source of this union tree to the type in the given result column list (which represents the result columns for an insert). This is only for table constructors that appear in insert statements.
| |
| tableConstructor | back to summary |
|---|---|
| pack-priv boolean tableConstructor() Tell whether this is a UNION for a table constructor. | |
| toString | back to summary |
|---|---|
| public String toString() Overrides org. Convert this object to a String. See comments in QueryTreeNode.java for how this should be done for tree printing. | |