Class RuleAssignOutputElements
- java.lang.Object
-
- org.teiid.query.optimizer.relational.rules.RuleAssignOutputElements
-
- All Implemented Interfaces:
OptimizerRule
public final class RuleAssignOutputElements extends Object implements OptimizerRule
This rule is responsible for assigning the output elements to every node in the plan. The output elements define the columns that are returned from every node. This is generally done by figuring out top-down all the elements required to execute the operation at each node and making sure those elements are selected from the children nodes.
-
-
Constructor Summary
Constructors Constructor Description RuleAssignOutputElements(boolean finalRun)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description PlanNode
execute(PlanNode plan, QueryMetadataInterface metadata, CapabilitiesFinder capFinder, RuleStack rules, AnalysisRecord analysisRecord, CommandContext context)
Execute the rule.static String
findFunctionTarget(Function function, FunctionDescriptor fd, CapabilitiesFinder capabiltiesFinder, QueryMetadataInterface metadata)
Find the first schema name against which this function can be executed, or null for no targetstatic Set<WindowFunction>
getWindowFunctions(List<Expression> projectCols)
String
toString()
Get name of the rule
-
-
-
Method Detail
-
execute
public PlanNode execute(PlanNode plan, QueryMetadataInterface metadata, CapabilitiesFinder capFinder, RuleStack rules, AnalysisRecord analysisRecord, CommandContext context) throws QueryPlannerException, QueryMetadataException, TeiidComponentException
Execute the rule. This rule is executed exactly once during every planning call. The plan is modified in place - only properties are manipulated, structure is unchanged.- Specified by:
execute
in interfaceOptimizerRule
- Parameters:
plan
- The plan to execute rule onmetadata
- The metadata interfacerules
- The rule stack, not modified- Returns:
- The updated plan
- Throws:
QueryPlannerException
QueryMetadataException
TeiidComponentException
-
getWindowFunctions
public static Set<WindowFunction> getWindowFunctions(List<Expression> projectCols)
-
findFunctionTarget
public static String findFunctionTarget(Function function, FunctionDescriptor fd, CapabilitiesFinder capabiltiesFinder, QueryMetadataInterface metadata) throws TeiidComponentException, QueryMetadataException
Find the first schema name against which this function can be executed, or null for no target- Parameters:
function
-fd
-capabiltiesFinder
-metadata
-- Returns:
- Throws:
TeiidComponentException
QueryMetadataException
-
-