use of org.apache.hyracks.algebricks.core.rewriter.base.IAlgebraicRewriteRule 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;
}
use of org.apache.hyracks.algebricks.core.rewriter.base.IAlgebraicRewriteRule in project asterixdb by apache.
the class RuleCollections method buildAutogenerateIDRuleCollection.
public static final List<IAlgebraicRewriteRule> buildAutogenerateIDRuleCollection() {
List<IAlgebraicRewriteRule> autogen = new LinkedList<>();
autogen.add(new IntroduceAutogenerateIDRule());
return autogen;
}
use of org.apache.hyracks.algebricks.core.rewriter.base.IAlgebraicRewriteRule in project asterixdb by apache.
the class RuleCollections method buildAccessMethodRuleCollection.
public static final List<IAlgebraicRewriteRule> buildAccessMethodRuleCollection() {
List<IAlgebraicRewriteRule> accessMethod = new LinkedList<>();
accessMethod.add(new IntroduceSelectAccessMethodRule());
accessMethod.add(new IntroduceJoinAccessMethodRule());
accessMethod.add(new IntroduceLSMComponentFilterRule());
accessMethod.add(new IntroduceSecondaryIndexInsertDeleteRule());
accessMethod.add(new RemoveUnusedOneToOneEquiJoinRule());
accessMethod.add(new PushSimilarityFunctionsBelowJoin());
accessMethod.add(new RemoveUnusedAssignAndAggregateRule());
return accessMethod;
}
use of org.apache.hyracks.algebricks.core.rewriter.base.IAlgebraicRewriteRule in project asterixdb by apache.
the class RuleCollections method buildPlanCleanupRuleCollection.
public static final List<IAlgebraicRewriteRule> buildPlanCleanupRuleCollection() {
List<IAlgebraicRewriteRule> planCleanupRules = new LinkedList<>();
planCleanupRules.add(new SwitchInnerJoinBranchRule());
planCleanupRules.add(new PushAssignBelowUnionAllRule());
planCleanupRules.add(new ExtractCommonExpressionsRule());
planCleanupRules.add(new RemoveRedundantVariablesRule());
planCleanupRules.add(new PushProjectDownRule());
planCleanupRules.add(new PushSelectDownRule());
planCleanupRules.add(new SetClosedRecordConstructorsRule());
planCleanupRules.add(new IntroduceDynamicTypeCastRule());
planCleanupRules.add(new IntroduceDynamicTypeCastForExternalFunctionRule());
planCleanupRules.add(new RemoveUnusedAssignAndAggregateRule());
planCleanupRules.add(new RemoveCartesianProductWithEmptyBranchRule());
planCleanupRules.add(new InjectTypeCastForSwitchCaseRule());
planCleanupRules.add(new InjectTypeCastForUnionRule());
// Needs to invoke ByNameToByIndexFieldAccessRule as the last logical optimization rule because
// some rules can push a FieldAccessByName to a place where the name it tries to access is in the closed part.
// For example, a possible scenario is that a field-access-by-name can be pushed down through UnionAllOperator.
planCleanupRules.add(new ByNameToByIndexFieldAccessRule());
return planCleanupRules;
}
use of org.apache.hyracks.algebricks.core.rewriter.base.IAlgebraicRewriteRule in project asterixdb by apache.
the class RuleCollections method buildTypeInferenceRuleCollection.
public static final List<IAlgebraicRewriteRule> buildTypeInferenceRuleCollection() {
List<IAlgebraicRewriteRule> typeInfer = new LinkedList<>();
typeInfer.add(new InlineUnnestFunctionRule());
typeInfer.add(new InferTypesRule());
typeInfer.add(new CheckFilterExpressionTypeRule());
return typeInfer;
}
Aggregations