public class AddOrderingColumnsToSources extends Object implements OptimizerRule
OptimizerRule
that adds any missing columns required by the ordering specifications to the SORT node's PROJECT, and
to the appropriate access nodes.Modifier and Type | Field and Description |
---|---|
static AddOrderingColumnsToSources |
INSTANCE |
Constructor and Description |
---|
AddOrderingColumnsToSources() |
Modifier and Type | Method and Description |
---|---|
protected boolean |
addIfMissing(QueryContext context,
Column column,
List<Column> columns,
List<String> columnTypes)
Check the supplied list of columns for an existing column that matches the supplied
Column , and if none is found
add the supplied Column to the list and add an appropriate type. |
protected boolean |
addSortColumn(QueryContext context,
PlanNode node,
Column sortColumn)
Make sure that the supplied column is included in the
projected columns on the supplied
plan node or its children. |
protected Column |
columnFor(SelectorName selector,
String property,
boolean includeSourceName) |
PlanNode |
execute(QueryContext context,
PlanNode plan,
LinkedList<OptimizerRule> ruleStack)
Optimize the supplied plan using the supplied context, hints, and yet-to-be-run rules.
|
String |
toString() |
public static final AddOrderingColumnsToSources INSTANCE
public PlanNode execute(QueryContext context, PlanNode plan, LinkedList<OptimizerRule> ruleStack)
OptimizerRule
execute
in interface OptimizerRule
context
- the context in which the query is being optimized; never nullplan
- the plan to be optimized; never nullruleStack
- the stack of rules that will be run after this rule; never nullprotected boolean addSortColumn(QueryContext context, PlanNode node, Column sortColumn)
projected columns
on the supplied
plan node or its children.context
- the query context; may not be nullnode
- the query plan nodesortColumn
- the column required by the sortprojected
columns
protected boolean addIfMissing(QueryContext context, Column column, List<Column> columns, List<String> columnTypes)
Column
, and if none is found
add the supplied Column to the list and add an appropriate type.context
- the query contextcolumn
- the column that will be added if not already in the list; may not be nullcolumns
- the list of columns; may not be nullcolumnTypes
- the list of column types; may not be nullprotected Column columnFor(SelectorName selector, String property, boolean includeSourceName)
Copyright © 2008–2016 JBoss, a division of Red Hat. All rights reserved.