use of org.apache.hyracks.algebricks.core.rewriter.base.IAlgebraicRewriteRule in project asterixdb by apache.
the class RuleCollections method prepareForJobGenRuleCollection.
public static final List<IAlgebraicRewriteRule> prepareForJobGenRuleCollection() {
List<IAlgebraicRewriteRule> prepareForJobGenRewrites = new LinkedList<>();
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 ReinferAllTypesRule());
prepareForJobGenRewrites.add(new PushGroupByIntoSortRule());
prepareForJobGenRewrites.add(new SetExecutionModeRule());
prepareForJobGenRewrites.add(new SweepIllegalNonfunctionalFunctions());
return prepareForJobGenRewrites;
}
use of org.apache.hyracks.algebricks.core.rewriter.base.IAlgebraicRewriteRule in project asterixdb by apache.
the class SequentialFixpointRuleController method rewriteWithRuleCollection.
@Override
public boolean rewriteWithRuleCollection(Mutable<ILogicalOperator> root, Collection<IAlgebraicRewriteRule> ruleCollection) throws AlgebricksException {
boolean anyRuleFired = false;
boolean anyChange = false;
do {
anyChange = false;
for (IAlgebraicRewriteRule rule : ruleCollection) {
boolean ruleFired = rewriteOperatorRef(root, rule, true, fullDfs);
if (ruleFired) {
anyChange = true;
anyRuleFired = true;
}
}
} while (anyChange);
return anyRuleFired;
}
use of org.apache.hyracks.algebricks.core.rewriter.base.IAlgebraicRewriteRule in project asterixdb by apache.
the class PigletCompiler method buildDefaultPhysicalRewrites.
private static List<Pair<AbstractRuleController, List<IAlgebraicRewriteRule>>> buildDefaultPhysicalRewrites() {
List<Pair<AbstractRuleController, List<IAlgebraicRewriteRule>>> defaultPhysicalRewrites = new ArrayList<Pair<AbstractRuleController, List<IAlgebraicRewriteRule>>>();
SequentialOnceRuleController seqOnceCtrlAllLevels = new SequentialOnceRuleController(true);
SequentialOnceRuleController seqOnceCtrlTopLevel = new SequentialOnceRuleController(false);
defaultPhysicalRewrites.add(new Pair<AbstractRuleController, List<IAlgebraicRewriteRule>>(seqOnceCtrlAllLevels, PigletRewriteRuleset.buildPhysicalRewritesAllLevelsRuleCollection()));
defaultPhysicalRewrites.add(new Pair<AbstractRuleController, List<IAlgebraicRewriteRule>>(seqOnceCtrlTopLevel, PigletRewriteRuleset.buildPhysicalRewritesTopLevelRuleCollection()));
defaultPhysicalRewrites.add(new Pair<AbstractRuleController, List<IAlgebraicRewriteRule>>(seqOnceCtrlAllLevels, PigletRewriteRuleset.prepareForJobGenRuleCollection()));
return defaultPhysicalRewrites;
}
use of org.apache.hyracks.algebricks.core.rewriter.base.IAlgebraicRewriteRule in project asterixdb by apache.
the class PigletCompiler method buildDefaultLogicalRewrites.
private static List<Pair<AbstractRuleController, List<IAlgebraicRewriteRule>>> buildDefaultLogicalRewrites() {
List<Pair<AbstractRuleController, List<IAlgebraicRewriteRule>>> defaultLogicalRewrites = new ArrayList<Pair<AbstractRuleController, List<IAlgebraicRewriteRule>>>();
SequentialFixpointRuleController seqCtrlNoDfs = new SequentialFixpointRuleController(false);
SequentialFixpointRuleController seqCtrlFullDfs = new SequentialFixpointRuleController(true);
SequentialOnceRuleController seqOnceCtrl = new SequentialOnceRuleController(true);
defaultLogicalRewrites.add(new Pair<AbstractRuleController, List<IAlgebraicRewriteRule>>(seqOnceCtrl, PigletRewriteRuleset.buildTypeInferenceRuleCollection()));
defaultLogicalRewrites.add(new Pair<AbstractRuleController, List<IAlgebraicRewriteRule>>(seqCtrlFullDfs, PigletRewriteRuleset.buildNormalizationRuleCollection()));
defaultLogicalRewrites.add(new Pair<AbstractRuleController, List<IAlgebraicRewriteRule>>(seqCtrlNoDfs, PigletRewriteRuleset.buildCondPushDownRuleCollection()));
defaultLogicalRewrites.add(new Pair<AbstractRuleController, List<IAlgebraicRewriteRule>>(seqCtrlNoDfs, PigletRewriteRuleset.buildJoinInferenceRuleCollection()));
defaultLogicalRewrites.add(new Pair<AbstractRuleController, List<IAlgebraicRewriteRule>>(seqCtrlNoDfs, PigletRewriteRuleset.buildOpPushDownRuleCollection()));
defaultLogicalRewrites.add(new Pair<AbstractRuleController, List<IAlgebraicRewriteRule>>(seqOnceCtrl, PigletRewriteRuleset.buildDataExchangeRuleCollection()));
defaultLogicalRewrites.add(new Pair<AbstractRuleController, List<IAlgebraicRewriteRule>>(seqCtrlNoDfs, PigletRewriteRuleset.buildConsolidationRuleCollection()));
return defaultLogicalRewrites;
}
use of org.apache.hyracks.algebricks.core.rewriter.base.IAlgebraicRewriteRule in project asterixdb by apache.
the class PigletRewriteRuleset method buildTypeInferenceRuleCollection.
public static final List<IAlgebraicRewriteRule> buildTypeInferenceRuleCollection() {
List<IAlgebraicRewriteRule> typeInfer = new LinkedList<IAlgebraicRewriteRule>();
typeInfer.add(new InferTypesRule());
return typeInfer;
}
Aggregations