|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.eigenbase.relopt.RelOptRule net.sf.farrago.query.FarragoReduceExpressionsRule
public abstract class FarragoReduceExpressionsRule
Collection of planner rules that apply various simplifying transformations on RexNode trees. Currently, there are two transformations:
Nested Class Summary | |
---|---|
private static class |
FarragoReduceExpressionsRule.ReducibleExprLocator
Helper class used to locate expressions that either can be reduced to literals or contain redundant casts. |
(package private) static class |
FarragoReduceExpressionsRule.ReentrantValuesStmt
Evaluates constant expressions via a reentrant query of the form "VALUES (exp1, exp2, exp3, ...)". |
private static class |
FarragoReduceExpressionsRule.RexReplacer
Replaces expressions with their reductions. |
Field Summary | |
---|---|
static FarragoReduceExpressionsRule |
calcInstance
|
static Pattern |
EXCLUSION_PATTERN
Regular expression which matches the description of all instances of this rule and FarragoReduceValuesRule also. |
static FarragoReduceExpressionsRule |
filterInstance
Singleton rule which reduces constants inside a FilterRel . |
static FarragoReduceExpressionsRule |
joinInstance
|
static FarragoReduceExpressionsRule |
projectInstance
|
Fields inherited from class org.eigenbase.relopt.RelOptRule |
---|
ANY, description, operands |
Constructor Summary | |
---|---|
private |
FarragoReduceExpressionsRule(Class<? extends RelNode> relClass)
Creates a new FarragoReduceExpressionsRule object. |
Method Summary | |
---|---|
private static void |
findReducibleExps(FarragoSessionPreparingStmt preparingStmt,
List<RexNode> exps,
List<RexNode> constExps,
List<Boolean> addCasts,
List<RexNode> removableCasts)
Locates expressions that can be reduced to literals or converted to expressions with redundant casts removed. |
(package private) static FarragoSession |
getSession(RelNode rel)
|
(package private) static boolean |
reduceExpressions(RelNode rel,
List<RexNode> expList)
Reduces a list of expressions. |
Methods inherited from class org.eigenbase.relopt.RelOptRule |
---|
convert, equals, equals, getOperand, getOperands, getOutConvention, getOutTrait, hashCode, matches, mergeTraitsAndConvert, mergeTraitsAndConvert, onMatch, toString |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final Pattern EXCLUSION_PATTERN
FarragoReduceValuesRule
also. Use
it to prevent the planner from invoking these rules.
public static final FarragoReduceExpressionsRule filterInstance
FilterRel
. If the
condition is a constant, the filter is removed (if TRUE) or replaced with
EmptyRel
(if FALSE or NULL).
public static final FarragoReduceExpressionsRule projectInstance
public static final FarragoReduceExpressionsRule joinInstance
public static final FarragoReduceExpressionsRule calcInstance
Constructor Detail |
---|
private FarragoReduceExpressionsRule(Class<? extends RelNode> relClass)
relClass
- class of rels to which this rule should applyMethod Detail |
---|
static boolean reduceExpressions(RelNode rel, List<RexNode> expList)
rel
- Relational expressionexpList
- List of expressions, modified in place
static FarragoSession getSession(RelNode rel)
private static void findReducibleExps(FarragoSessionPreparingStmt preparingStmt, List<RexNode> exps, List<RexNode> constExps, List<Boolean> addCasts, List<RexNode> removableCasts)
preparingStmt
- the statement containing the expressionsexps
- list of candidate expressions to be examined for reductionconstExps
- returns the list of expressions that can be constant
reducedaddCasts
- indicator for each expression that can be constant
reduced, whether a cast of the resulting reduced expression is
potentially necessaryremovableCasts
- returns the list of cast expressions where the cast
can be removed
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |