Search in sources :

Example 6 with IAlgebraicRewriteRule

use of org.apache.hyracks.algebricks.core.rewriter.base.IAlgebraicRewriteRule in project asterixdb by apache.

the class PigletRewriteRuleset method buildConsolidationRuleCollection.

public static final List<IAlgebraicRewriteRule> buildConsolidationRuleCollection() {
    List<IAlgebraicRewriteRule> consolidation = new LinkedList<IAlgebraicRewriteRule>();
    consolidation.add(new ConsolidateSelectsRule());
    consolidation.add(new ConsolidateAssignsRule());
    consolidation.add(new RemoveUnusedAssignAndAggregateRule());
    return consolidation;
}
Also used : ConsolidateAssignsRule(org.apache.hyracks.algebricks.rewriter.rules.ConsolidateAssignsRule) IAlgebraicRewriteRule(org.apache.hyracks.algebricks.core.rewriter.base.IAlgebraicRewriteRule) RemoveUnusedAssignAndAggregateRule(org.apache.hyracks.algebricks.rewriter.rules.RemoveUnusedAssignAndAggregateRule) LinkedList(java.util.LinkedList) ConsolidateSelectsRule(org.apache.hyracks.algebricks.rewriter.rules.ConsolidateSelectsRule)

Example 7 with IAlgebraicRewriteRule

use of org.apache.hyracks.algebricks.core.rewriter.base.IAlgebraicRewriteRule in project asterixdb by apache.

the class RuleCollections method buildDataExchangeRuleCollection.

public static final List<IAlgebraicRewriteRule> buildDataExchangeRuleCollection() {
    List<IAlgebraicRewriteRule> dataExchange = new LinkedList<>();
    dataExchange.add(new SetExecutionModeRule());
    return dataExchange;
}
Also used : SetExecutionModeRule(org.apache.hyracks.algebricks.rewriter.rules.SetExecutionModeRule) IAlgebraicRewriteRule(org.apache.hyracks.algebricks.core.rewriter.base.IAlgebraicRewriteRule) LinkedList(java.util.LinkedList)

Example 8 with IAlgebraicRewriteRule

use of org.apache.hyracks.algebricks.core.rewriter.base.IAlgebraicRewriteRule in project asterixdb by apache.

the class RuleCollections method buildInitialTranslationRuleCollection.

public static final List<IAlgebraicRewriteRule> buildInitialTranslationRuleCollection() {
    List<IAlgebraicRewriteRule> translationRules = new LinkedList<>();
    translationRules.add(new TranslateIntervalExpressionRule());
    translationRules.add(new ExtractGroupByDecorVariablesRule());
    return translationRules;
}
Also used : ExtractGroupByDecorVariablesRule(org.apache.hyracks.algebricks.rewriter.rules.ExtractGroupByDecorVariablesRule) IAlgebraicRewriteRule(org.apache.hyracks.algebricks.core.rewriter.base.IAlgebraicRewriteRule) TranslateIntervalExpressionRule(org.apache.asterix.optimizer.rules.temporal.TranslateIntervalExpressionRule) LinkedList(java.util.LinkedList)

Example 9 with IAlgebraicRewriteRule

use of org.apache.hyracks.algebricks.core.rewriter.base.IAlgebraicRewriteRule in project asterixdb by apache.

the class RuleCollections method buildConsolidationRuleCollection.

public static final List<IAlgebraicRewriteRule> buildConsolidationRuleCollection() {
    List<IAlgebraicRewriteRule> consolidation = new LinkedList<>();
    consolidation.add(new ConsolidateSelectsRule());
    consolidation.add(new ConsolidateAssignsRule());
    consolidation.add(new InlineAssignIntoAggregateRule());
    consolidation.add(new AsterixIntroduceGroupByCombinerRule());
    consolidation.add(new IntroduceAggregateCombinerRule());
    consolidation.add(new CountVarToCountOneRule());
    consolidation.add(new RemoveUnusedAssignAndAggregateRule());
    consolidation.add(new RemoveRedundantGroupByDecorVarsRule());
    //PushUnnestDownUnion => RemoveRedundantListifyRule cause these rules are correlated
    consolidation.add(new PushUnnestDownThroughUnionRule());
    consolidation.add(new RemoveRedundantListifyRule());
    return consolidation;
}
Also used : RemoveRedundantListifyRule(org.apache.asterix.optimizer.rules.RemoveRedundantListifyRule) ConsolidateAssignsRule(org.apache.hyracks.algebricks.rewriter.rules.ConsolidateAssignsRule) InlineAssignIntoAggregateRule(org.apache.hyracks.algebricks.rewriter.rules.InlineAssignIntoAggregateRule) RemoveRedundantGroupByDecorVarsRule(org.apache.hyracks.algebricks.rewriter.rules.RemoveRedundantGroupByDecorVarsRule) LinkedList(java.util.LinkedList) ConsolidateSelectsRule(org.apache.hyracks.algebricks.rewriter.rules.ConsolidateSelectsRule) PushUnnestDownThroughUnionRule(org.apache.hyracks.algebricks.rewriter.rules.PushUnnestDownThroughUnionRule) IAlgebraicRewriteRule(org.apache.hyracks.algebricks.core.rewriter.base.IAlgebraicRewriteRule) AsterixIntroduceGroupByCombinerRule(org.apache.asterix.optimizer.rules.AsterixIntroduceGroupByCombinerRule) RemoveUnusedAssignAndAggregateRule(org.apache.hyracks.algebricks.rewriter.rules.RemoveUnusedAssignAndAggregateRule) CountVarToCountOneRule(org.apache.asterix.optimizer.rules.CountVarToCountOneRule) IntroduceAggregateCombinerRule(org.apache.hyracks.algebricks.rewriter.rules.IntroduceAggregateCombinerRule)

Example 10 with IAlgebraicRewriteRule

use of org.apache.hyracks.algebricks.core.rewriter.base.IAlgebraicRewriteRule in project asterixdb by apache.

the class RuleCollections method buildPhysicalRewritesAllLevelsRuleCollection.

public static final List<IAlgebraicRewriteRule> buildPhysicalRewritesAllLevelsRuleCollection() {
    List<IAlgebraicRewriteRule> physicalRewritesAllLevels = new LinkedList<>();
    physicalRewritesAllLevels.add(new PullSelectOutOfEqJoin());
    //Turned off the following rule for now not to change OptimizerTest results.
    physicalRewritesAllLevels.add(new SetupCommitExtensionOpRule());
    physicalRewritesAllLevels.add(new SetAlgebricksPhysicalOperatorsRule());
    physicalRewritesAllLevels.add(new SetAsterixPhysicalOperatorsRule());
    physicalRewritesAllLevels.add(new AddEquivalenceClassForRecordConstructorRule());
    physicalRewritesAllLevels.add(new EnforceStructuralPropertiesRule());
    physicalRewritesAllLevels.add(new RemoveSortInFeedIngestionRule());
    physicalRewritesAllLevels.add(new RemoveUnnecessarySortMergeExchange());
    physicalRewritesAllLevels.add(new PushProjectDownRule());
    physicalRewritesAllLevels.add(new InsertProjectBeforeUnionRule());
    physicalRewritesAllLevels.add(new IntroduceMaterializationForInsertWithSelfScanRule());
    physicalRewritesAllLevels.add(new InlineSingleReferenceVariablesRule());
    physicalRewritesAllLevels.add(new RemoveUnusedAssignAndAggregateRule());
    physicalRewritesAllLevels.add(new ConsolidateAssignsRule());
    // After adding projects, we may need need to set physical operators again.
    physicalRewritesAllLevels.add(new SetAlgebricksPhysicalOperatorsRule());
    return physicalRewritesAllLevels;
}
Also used : PushProjectDownRule(org.apache.hyracks.algebricks.rewriter.rules.PushProjectDownRule) ConsolidateAssignsRule(org.apache.hyracks.algebricks.rewriter.rules.ConsolidateAssignsRule) InsertProjectBeforeUnionRule(org.apache.hyracks.algebricks.rewriter.rules.InsertProjectBeforeUnionRule) SetAsterixPhysicalOperatorsRule(org.apache.asterix.optimizer.rules.SetAsterixPhysicalOperatorsRule) InlineSingleReferenceVariablesRule(org.apache.hyracks.algebricks.rewriter.rules.InlineSingleReferenceVariablesRule) LinkedList(java.util.LinkedList) RemoveUnnecessarySortMergeExchange(org.apache.hyracks.algebricks.rewriter.rules.RemoveUnnecessarySortMergeExchange) IntroduceMaterializationForInsertWithSelfScanRule(org.apache.asterix.optimizer.rules.IntroduceMaterializationForInsertWithSelfScanRule) SetupCommitExtensionOpRule(org.apache.asterix.optimizer.rules.SetupCommitExtensionOpRule) IAlgebraicRewriteRule(org.apache.hyracks.algebricks.core.rewriter.base.IAlgebraicRewriteRule) AddEquivalenceClassForRecordConstructorRule(org.apache.asterix.optimizer.rules.AddEquivalenceClassForRecordConstructorRule) RemoveSortInFeedIngestionRule(org.apache.asterix.optimizer.rules.RemoveSortInFeedIngestionRule) EnforceStructuralPropertiesRule(org.apache.hyracks.algebricks.rewriter.rules.EnforceStructuralPropertiesRule) RemoveUnusedAssignAndAggregateRule(org.apache.hyracks.algebricks.rewriter.rules.RemoveUnusedAssignAndAggregateRule) PullSelectOutOfEqJoin(org.apache.hyracks.algebricks.rewriter.rules.PullSelectOutOfEqJoin) SetAlgebricksPhysicalOperatorsRule(org.apache.hyracks.algebricks.rewriter.rules.SetAlgebricksPhysicalOperatorsRule)

Aggregations

IAlgebraicRewriteRule (org.apache.hyracks.algebricks.core.rewriter.base.IAlgebraicRewriteRule)31 LinkedList (java.util.LinkedList)25 RemoveUnusedAssignAndAggregateRule (org.apache.hyracks.algebricks.rewriter.rules.RemoveUnusedAssignAndAggregateRule)7 ArrayList (java.util.ArrayList)5 Pair (org.apache.hyracks.algebricks.common.utils.Pair)4 SequentialOnceRuleController (org.apache.hyracks.algebricks.compiler.rewriter.rulecontrollers.SequentialOnceRuleController)4 PushProjectDownRule (org.apache.hyracks.algebricks.rewriter.rules.PushProjectDownRule)4 PushSelectDownRule (org.apache.hyracks.algebricks.rewriter.rules.PushSelectDownRule)4 SetExecutionModeRule (org.apache.hyracks.algebricks.rewriter.rules.SetExecutionModeRule)4 EliminateSubplanRule (org.apache.hyracks.algebricks.rewriter.rules.subplan.EliminateSubplanRule)4 ConstantFoldingRule (org.apache.asterix.optimizer.rules.ConstantFoldingRule)3 ConsolidateAssignsRule (org.apache.hyracks.algebricks.rewriter.rules.ConsolidateAssignsRule)3 CopyLimitDownRule (org.apache.hyracks.algebricks.rewriter.rules.CopyLimitDownRule)3 InferTypesRule (org.apache.hyracks.algebricks.rewriter.rules.InferTypesRule)3 List (java.util.List)2 AsterixInlineVariablesRule (org.apache.asterix.optimizer.rules.AsterixInlineVariablesRule)2 ByNameToByIndexFieldAccessRule (org.apache.asterix.optimizer.rules.ByNameToByIndexFieldAccessRule)2 IntroduceDynamicTypeCastForExternalFunctionRule (org.apache.asterix.optimizer.rules.IntroduceDynamicTypeCastForExternalFunctionRule)2 IntroduceDynamicTypeCastRule (org.apache.asterix.optimizer.rules.IntroduceDynamicTypeCastRule)2 RemoveRedundantListifyRule (org.apache.asterix.optimizer.rules.RemoveRedundantListifyRule)2