com.metamatrix.query.processor.relational
Class DependentSelectNode

java.lang.Object
  extended by com.metamatrix.query.processor.relational.RelationalNode
      extended by com.metamatrix.query.processor.relational.SelectNode
          extended by com.metamatrix.query.processor.relational.DependentSelectNode
All Implemented Interfaces:
Describable, java.lang.Cloneable

public class DependentSelectNode
extends SelectNode

This node represents a Select node for the case where the criteria is or is composed of one or more SubqueryContainer criteria objects (for subqueries in the criteria). In that case, all the corresponding "child" or "sub" ProcessorPlans (one for each SubqueryContainer criteria) must be processed before the entire criteria can be evaluated.


Field Summary
 
Fields inherited from interface com.metamatrix.query.processor.Describable
PROP_BINDINGS, PROP_CHILDREN, PROP_CONDITIONS, PROP_CRITERIA, PROP_DATA_COL, PROP_DEFAULT, PROP_DEFAULT_PROGRAM, PROP_ELSE, PROP_ENCODING, PROP_EXECUTION_PLAN, PROP_EXPRESSION, PROP_FORMATTED, PROP_GROUP, PROP_GROUP_COLS, PROP_IN_MEMORY, PROP_INTO_GROUP, PROP_IS_STAGING, PROP_JOIN_CRITERIA, PROP_JOIN_STRATEGY, PROP_JOIN_TYPE, PROP_MESSAGE, PROP_MODEL_NAME, PROP_NAMESPACE, PROP_NAMESPACE_DECL, PROP_NODE_COST_ESTIMATES, PROP_NODE_STATS_LIST, PROP_NODE_STATS_PROPS, PROP_OPTIONAL, PROP_OUTPUT_COLS, PROP_PROGRAM, PROP_PROGRAMS, PROP_RECURSE_DIR, PROP_REMOVE_DUPS, PROP_RESULT_SET, PROP_ROW_LIMIT, PROP_ROW_OFFSET, PROP_SELECT_COLS, PROP_SORT_COLS, PROP_SQL, PROP_TAG, PROP_THEN, PROP_TYPE, PROP_VARIABLE
 
Constructor Summary
DependentSelectNode(int nodeID)
          Constructor for DependentSelectNode.
 
Method Summary
 java.lang.Object clone()
          Returns a deep clone
 void close()
          Closes the subquery processor (which removes the temporary tuple sources of the subquery results)
 java.util.List getChildPlans()
          Find all ProcessorPlans used by this node.
 java.util.Map getDescriptionProperties()
          Get a description as a set of properties of primitive types such as String, Integer, etc.
 void open()
          Calls super.open(), then initializes subquery processor
protected  void prepareToProcessTuple(java.util.Map elementMap, java.util.List currentTuple)
          This subclass will execute any subqueries which the criteria is dependent on; if any subqueries are correlated, this class will use the current tuple to execute correlated subqueries
 void reset()
           
 void setCorrelatedReferences(java.util.List correlatedReferences)
          Set List of References needing to be updated with each outer tuple
 void setPlansAndCriteriaMapping(java.util.List subqueryProcessorPlans, java.util.List subqueryContainerCriteria)
          Set the two Lists that map subquery ProcessorPlans to SubqueryContainer criteria which hold the Commands represented by the ProcessorPlans.
 
Methods inherited from class com.metamatrix.query.processor.relational.SelectNode
copy, getCriteria, getNodeString, nextBatchDirect, setCriteria
 
Methods inherited from class com.metamatrix.query.processor.relational.RelationalNode
addBatchRow, addChild, copy, createLookupMap, getBatchSize, getBufferManager, getChildDescriptionProperties, getChildren, getClassName, getConnectionID, getContext, getDataManager, getElements, getEstimateNodeCardinality, getID, getNodeStatistics, getParent, initialize, isBatchFull, isClosed, nextBatch, nodeToString, projectTuple, pullBatch, setElements, setEstimateDepAccessCardinality, setEstimateDepJoinCost, setEstimateJoinCost, setEstimateNodeCardinality, setEstimateNodeSetSize, setID, setParent, terminateBatches, toString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DependentSelectNode

public DependentSelectNode(int nodeID)
Constructor for DependentSelectNode.

Parameters:
nodeID -
Method Detail

setPlansAndCriteriaMapping

public void setPlansAndCriteriaMapping(java.util.List subqueryProcessorPlans,
                                       java.util.List subqueryContainerCriteria)
Set the two Lists that map subquery ProcessorPlans to SubqueryContainer criteria which hold the Commands represented by the ProcessorPlans. The objects at each index of both lists are essentially "mapped" to each other, one to one. At a given index, the ProcessorPlan in the one List will be processed and "fill" the SubqueryContainer criteria (of the other List) so the SubqueryContainer criteria can be evalutated later.

Parameters:
subqueryProcessorPlans - List of ProcessorPlans
subqueryContainerCriteria - List of SubqueryContainer criteria

setCorrelatedReferences

public void setCorrelatedReferences(java.util.List correlatedReferences)
Set List of References needing to be updated with each outer tuple

Parameters:
correlatedReferences - List correlated reference to outer query

reset

public void reset()
Overrides:
reset in class SelectNode

open

public void open()
          throws MetaMatrixComponentException,
                 MetaMatrixProcessingException
Calls super.open(), then initializes subquery processor

Overrides:
open in class SelectNode
Throws:
MetaMatrixComponentException
MetaMatrixProcessingException

close

public void close()
           throws MetaMatrixComponentException
Closes the subquery processor (which removes the temporary tuple sources of the subquery results)

Overrides:
close in class RelationalNode
Throws:
MetaMatrixComponentException
See Also:
RelationalNode.close()

prepareToProcessTuple

protected void prepareToProcessTuple(java.util.Map elementMap,
                                     java.util.List currentTuple)
                              throws BlockedException,
                                     MetaMatrixComponentException,
                                     MetaMatrixProcessingException
This subclass will execute any subqueries which the criteria is dependent on; if any subqueries are correlated, this class will use the current tuple to execute correlated subqueries

Overrides:
prepareToProcessTuple in class SelectNode
Parameters:
elementMap - Map of ElementSymbol elements to Integer indices into the currentTuple parameter
currentTuple - the current tuple about to be processed by this node
Throws:
MetaMatrixProcessingException - for exception due to user input
BlockedException
MetaMatrixComponentException
See Also:
SelectNode.prepareToProcessTuple(java.util.Map, java.util.List)

clone

public java.lang.Object clone()
Returns a deep clone

Overrides:
clone in class SelectNode
Returns:
deep clone of this object
See Also:
Object.clone()

getDescriptionProperties

public java.util.Map getDescriptionProperties()
Description copied from interface: Describable
Get a description as a set of properties of primitive types such as String, Integer, etc.

Specified by:
getDescriptionProperties in interface Describable
Overrides:
getDescriptionProperties in class SelectNode
Returns:
Map of properties

getChildPlans

public java.util.List getChildPlans()
Description copied from class: RelationalNode
Find all ProcessorPlans used by this node. If no plans are used, null may be returned. The default implementation will return null.

Overrides:
getChildPlans in class RelationalNode
Returns:
List of ProcessorPlan or null if none
Since:
4.2
See Also:
com.metamatrix.query.processor.relational.RelationalNode#getSubPlans()


Copyright © 2009. All Rights Reserved.