Search in sources :

Example 1 with SequentialOnceRuleController

use of org.apache.hyracks.algebricks.compiler.rewriter.rulecontrollers.SequentialOnceRuleController 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;
}
Also used : SequentialOnceRuleController(org.apache.hyracks.algebricks.compiler.rewriter.rulecontrollers.SequentialOnceRuleController) IAlgebraicRewriteRule(org.apache.hyracks.algebricks.core.rewriter.base.IAlgebraicRewriteRule) ArrayList(java.util.ArrayList) Pair(org.apache.hyracks.algebricks.common.utils.Pair)

Example 2 with SequentialOnceRuleController

use of org.apache.hyracks.algebricks.compiler.rewriter.rulecontrollers.SequentialOnceRuleController 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;
}
Also used : AbstractRuleController(org.apache.hyracks.algebricks.core.rewriter.base.AbstractRuleController) SequentialOnceRuleController(org.apache.hyracks.algebricks.compiler.rewriter.rulecontrollers.SequentialOnceRuleController) IAlgebraicRewriteRule(org.apache.hyracks.algebricks.core.rewriter.base.IAlgebraicRewriteRule) ArrayList(java.util.ArrayList) List(java.util.List) ArrayList(java.util.ArrayList) Pair(org.apache.hyracks.algebricks.common.utils.Pair)

Example 3 with SequentialOnceRuleController

use of org.apache.hyracks.algebricks.compiler.rewriter.rulecontrollers.SequentialOnceRuleController 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;
}
Also used : AbstractRuleController(org.apache.hyracks.algebricks.core.rewriter.base.AbstractRuleController) SequentialOnceRuleController(org.apache.hyracks.algebricks.compiler.rewriter.rulecontrollers.SequentialOnceRuleController) IAlgebraicRewriteRule(org.apache.hyracks.algebricks.core.rewriter.base.IAlgebraicRewriteRule) SequentialFixpointRuleController(org.apache.hyracks.algebricks.compiler.rewriter.rulecontrollers.SequentialFixpointRuleController) ArrayList(java.util.ArrayList) List(java.util.List) ArrayList(java.util.ArrayList) Pair(org.apache.hyracks.algebricks.common.utils.Pair)

Example 4 with SequentialOnceRuleController

use of org.apache.hyracks.algebricks.compiler.rewriter.rulecontrollers.SequentialOnceRuleController in project asterixdb by apache.

the class DefaultRuleSetFactory method buildLogical.

public static List<Pair<AbstractRuleController, List<IAlgebraicRewriteRule>>> buildLogical(ICcApplicationContext appCtx) {
    List<Pair<AbstractRuleController, List<IAlgebraicRewriteRule>>> defaultLogicalRewrites = new ArrayList<>();
    SequentialFixpointRuleController seqCtrlNoDfs = new SequentialFixpointRuleController(false);
    SequentialFixpointRuleController seqCtrlFullDfs = new SequentialFixpointRuleController(true);
    SequentialOnceRuleController seqOnceCtrl = new SequentialOnceRuleController(true);
    defaultLogicalRewrites.add(new Pair<>(seqOnceCtrl, RuleCollections.buildInitialTranslationRuleCollection()));
    defaultLogicalRewrites.add(new Pair<>(seqOnceCtrl, RuleCollections.buildTypeInferenceRuleCollection()));
    defaultLogicalRewrites.add(new Pair<>(seqOnceCtrl, RuleCollections.buildAutogenerateIDRuleCollection()));
    defaultLogicalRewrites.add(new Pair<>(seqCtrlFullDfs, RuleCollections.buildNormalizationRuleCollection(appCtx)));
    defaultLogicalRewrites.add(new Pair<>(seqCtrlNoDfs, RuleCollections.buildCondPushDownAndJoinInferenceRuleCollection()));
    defaultLogicalRewrites.add(new Pair<>(seqCtrlFullDfs, RuleCollections.buildLoadFieldsRuleCollection(appCtx)));
    // fj
    defaultLogicalRewrites.add(new Pair<>(seqCtrlFullDfs, RuleCollections.buildFuzzyJoinRuleCollection()));
    //
    defaultLogicalRewrites.add(new Pair<>(seqCtrlFullDfs, RuleCollections.buildNormalizationRuleCollection(appCtx)));
    defaultLogicalRewrites.add(new Pair<>(seqCtrlNoDfs, RuleCollections.buildCondPushDownAndJoinInferenceRuleCollection()));
    defaultLogicalRewrites.add(new Pair<>(seqCtrlFullDfs, RuleCollections.buildLoadFieldsRuleCollection(appCtx)));
    defaultLogicalRewrites.add(new Pair<>(seqOnceCtrl, RuleCollections.buildDataExchangeRuleCollection()));
    defaultLogicalRewrites.add(new Pair<>(seqCtrlNoDfs, RuleCollections.buildConsolidationRuleCollection()));
    defaultLogicalRewrites.add(new Pair<>(seqOnceCtrl, RuleCollections.buildFulltextContainsRuleCollection()));
    defaultLogicalRewrites.add(new Pair<>(seqCtrlNoDfs, RuleCollections.buildAccessMethodRuleCollection()));
    defaultLogicalRewrites.add(new Pair<>(seqCtrlNoDfs, RuleCollections.buildPlanCleanupRuleCollection()));
    //put TXnRuleCollection!
    return defaultLogicalRewrites;
}
Also used : SequentialOnceRuleController(org.apache.hyracks.algebricks.compiler.rewriter.rulecontrollers.SequentialOnceRuleController) IAlgebraicRewriteRule(org.apache.hyracks.algebricks.core.rewriter.base.IAlgebraicRewriteRule) SequentialFixpointRuleController(org.apache.hyracks.algebricks.compiler.rewriter.rulecontrollers.SequentialFixpointRuleController) ArrayList(java.util.ArrayList) Pair(org.apache.hyracks.algebricks.common.utils.Pair)

Aggregations

ArrayList (java.util.ArrayList)4 Pair (org.apache.hyracks.algebricks.common.utils.Pair)4 SequentialOnceRuleController (org.apache.hyracks.algebricks.compiler.rewriter.rulecontrollers.SequentialOnceRuleController)4 IAlgebraicRewriteRule (org.apache.hyracks.algebricks.core.rewriter.base.IAlgebraicRewriteRule)4 List (java.util.List)2 SequentialFixpointRuleController (org.apache.hyracks.algebricks.compiler.rewriter.rulecontrollers.SequentialFixpointRuleController)2 AbstractRuleController (org.apache.hyracks.algebricks.core.rewriter.base.AbstractRuleController)2