use of org.apache.hyracks.algebricks.core.rewriter.base.IAlgebraicRewriteRule in project asterixdb by apache.
the class DefaultRuleSetFactory method buildPhysical.
public static List<Pair<AbstractRuleController, List<IAlgebraicRewriteRule>>> buildPhysical(ICcApplicationContext appCtx) {
List<Pair<AbstractRuleController, List<IAlgebraicRewriteRule>>> defaultPhysicalRewrites = new ArrayList<>();
SequentialOnceRuleController seqOnceCtrl = new SequentialOnceRuleController(true);
SequentialOnceRuleController seqOnceTopLevel = new SequentialOnceRuleController(false);
defaultPhysicalRewrites.add(new Pair<>(seqOnceCtrl, RuleCollections.buildPhysicalRewritesAllLevelsRuleCollection()));
defaultPhysicalRewrites.add(new Pair<>(seqOnceTopLevel, RuleCollections.buildPhysicalRewritesTopLevelRuleCollection(appCtx)));
defaultPhysicalRewrites.add(new Pair<>(seqOnceCtrl, RuleCollections.prepareForJobGenRuleCollection()));
return defaultPhysicalRewrites;
}
use of org.apache.hyracks.algebricks.core.rewriter.base.IAlgebraicRewriteRule in project asterixdb by apache.
the class RuleCollections method buildCondPushDownAndJoinInferenceRuleCollection.
public static final List<IAlgebraicRewriteRule> buildCondPushDownAndJoinInferenceRuleCollection() {
List<IAlgebraicRewriteRule> condPushDownAndJoinInference = new LinkedList<>();
condPushDownAndJoinInference.add(new PushSelectDownRule());
condPushDownAndJoinInference.add(new PushSortDownRule());
condPushDownAndJoinInference.add(new RemoveRedundantListifyRule());
condPushDownAndJoinInference.add(new CancelUnnestWithNestedListifyRule());
condPushDownAndJoinInference.add(new SimpleUnnestToProductRule());
condPushDownAndJoinInference.add(new ComplexUnnestToProductRule());
condPushDownAndJoinInference.add(new DisjunctivePredicateToJoinRule());
condPushDownAndJoinInference.add(new PushSelectIntoJoinRule());
condPushDownAndJoinInference.add(new IntroJoinInsideSubplanRule());
// Apply RemoveCartesianProductWithEmptyBranchRule before PushMapOperatorDownThroughProductRule
// to avoid that a constant assignment gets pushed into an empty branch.
condPushDownAndJoinInference.add(new RemoveCartesianProductWithEmptyBranchRule());
condPushDownAndJoinInference.add(new PushMapOperatorDownThroughProductRule());
condPushDownAndJoinInference.add(new PushSubplanWithAggregateDownThroughProductRule());
condPushDownAndJoinInference.add(new SubplanOutOfGroupRule());
condPushDownAndJoinInference.add(new AsterixExtractFunctionsFromJoinConditionRule());
condPushDownAndJoinInference.add(new RemoveRedundantVariablesRule());
condPushDownAndJoinInference.add(new AsterixInlineVariablesRule());
condPushDownAndJoinInference.add(new RemoveUnusedAssignAndAggregateRule());
condPushDownAndJoinInference.add(new FactorRedundantGroupAndDecorVarsRule());
condPushDownAndJoinInference.add(new PushAggregateIntoNestedSubplanRule());
condPushDownAndJoinInference.add(new EliminateSubplanRule());
condPushDownAndJoinInference.add(new PushProperJoinThroughProduct());
condPushDownAndJoinInference.add(new PushGroupByThroughProduct());
condPushDownAndJoinInference.add(new NestGroupByRule());
condPushDownAndJoinInference.add(new EliminateGroupByEmptyKeyRule());
condPushDownAndJoinInference.add(new PushSubplanIntoGroupByRule());
condPushDownAndJoinInference.add(new NestedSubplanToJoinRule());
condPushDownAndJoinInference.add(new EliminateSubplanWithInputCardinalityOneRule());
// The following rule should be fired after PushAggregateIntoNestedSubplanRule because
// pulling invariants out of a subplan will make PushAggregateIntoGroupby harder.
condPushDownAndJoinInference.add(new AsterixMoveFreeVariableOperatorOutOfSubplanRule());
return condPushDownAndJoinInference;
}
use of org.apache.hyracks.algebricks.core.rewriter.base.IAlgebraicRewriteRule in project asterixdb by apache.
the class PigletRewriteRuleset method buildCondPushDownRuleCollection.
public static final List<IAlgebraicRewriteRule> buildCondPushDownRuleCollection() {
List<IAlgebraicRewriteRule> condPushDown = new LinkedList<IAlgebraicRewriteRule>();
condPushDown.add(new PushSelectDownRule());
condPushDown.add(new InlineVariablesRule());
condPushDown.add(new FactorRedundantGroupAndDecorVarsRule());
condPushDown.add(new EliminateSubplanRule());
return condPushDown;
}
use of org.apache.hyracks.algebricks.core.rewriter.base.IAlgebraicRewriteRule in project asterixdb by apache.
the class PigletRewriteRuleset method buildPhysicalRewritesAllLevelsRuleCollection.
public static final List<IAlgebraicRewriteRule> buildPhysicalRewritesAllLevelsRuleCollection() {
List<IAlgebraicRewriteRule> physicalPlanRewrites = new LinkedList<IAlgebraicRewriteRule>();
physicalPlanRewrites.add(new PullSelectOutOfEqJoin());
physicalPlanRewrites.add(new SetAlgebricksPhysicalOperatorsRule());
physicalPlanRewrites.add(new EnforceStructuralPropertiesRule());
physicalPlanRewrites.add(new PushProjectDownRule());
physicalPlanRewrites.add(new CopyLimitDownRule());
return physicalPlanRewrites;
}
use of org.apache.hyracks.algebricks.core.rewriter.base.IAlgebraicRewriteRule in project asterixdb by apache.
the class PigletRewriteRuleset method prepareForJobGenRuleCollection.
public static final List<IAlgebraicRewriteRule> prepareForJobGenRuleCollection() {
List<IAlgebraicRewriteRule> prepareForJobGenRewrites = new LinkedList<IAlgebraicRewriteRule>();
prepareForJobGenRewrites.add(new IsolateHyracksOperatorsRule(HeuristicOptimizer.hyraxOperatorsBelowWhichJobGenIsDisabled));
prepareForJobGenRewrites.add(new ExtractCommonOperatorsRule());
// Re-infer all types, so that, e.g., the effect of not-is-null is
// propagated.
prepareForJobGenRewrites.add(new PushProjectIntoDataSourceScanRule());
prepareForJobGenRewrites.add(new ReinferAllTypesRule());
return prepareForJobGenRewrites;
}
Aggregations