use of org.apache.asterix.optimizer.rules.ConstantFoldingRule in project asterixdb by apache.
the class RuleCollections method buildNormalizationRuleCollection.
public static final List<IAlgebraicRewriteRule> buildNormalizationRuleCollection(ICcApplicationContext appCtx) {
List<IAlgebraicRewriteRule> normalization = new LinkedList<>();
normalization.add(new ResolveVariableRule());
normalization.add(new CheckInsertUpsertReturningRule());
normalization.add(new IntroduceUnnestForCollectionToSequenceRule());
normalization.add(new EliminateSubplanRule());
normalization.add(new EnforceOrderByAfterSubplan());
normalization.add(new BreakSelectIntoConjunctsRule());
normalization.add(new ExtractGbyExpressionsRule());
normalization.add(new ExtractDistinctByExpressionsRule());
normalization.add(new ExtractOrderExpressionsRule());
// IntroduceStaticTypeCastRule should go before
// IntroduceDynamicTypeCastRule to
// avoid unnecessary dynamic casting
normalization.add(new IntroduceStaticTypeCastForInsertRule());
normalization.add(new IntroduceDynamicTypeCastRule());
normalization.add(new IntroduceDynamicTypeCastForExternalFunctionRule());
normalization.add(new IntroduceEnforcedListTypeRule());
normalization.add(new ExtractCommonExpressionsRule());
// Let PushAggFuncIntoStandaloneAggregateRule run after ExtractCommonExpressionsRule
// so that PushAggFunc can happen in fewer places.
normalization.add(new PushAggFuncIntoStandaloneAggregateRule());
normalization.add(new ListifyUnnestingFunctionRule());
normalization.add(new ConstantFoldingRule(appCtx));
normalization.add(new RemoveRedundantSelectRule());
normalization.add(new UnnestToDataScanRule());
normalization.add(new MetaFunctionToMetaVariableRule());
normalization.add(new FuzzyEqRule());
normalization.add(new SimilarityCheckRule());
return normalization;
}
use of org.apache.asterix.optimizer.rules.ConstantFoldingRule in project asterixdb by apache.
the class RuleCollections method buildLoadFieldsRuleCollection.
public static final List<IAlgebraicRewriteRule> buildLoadFieldsRuleCollection(ICcApplicationContext appCtx) {
List<IAlgebraicRewriteRule> fieldLoads = new LinkedList<>();
fieldLoads.add(new LoadRecordFieldsRule());
fieldLoads.add(new PushFieldAccessRule());
// fieldLoads.add(new ByNameToByHandleFieldAccessRule()); -- disabled
fieldLoads.add(new ByNameToByIndexFieldAccessRule());
fieldLoads.add(new RemoveRedundantVariablesRule());
fieldLoads.add(new AsterixInlineVariablesRule());
fieldLoads.add(new RemoveUnusedAssignAndAggregateRule());
fieldLoads.add(new ConstantFoldingRule(appCtx));
fieldLoads.add(new RemoveRedundantSelectRule());
fieldLoads.add(new FeedScanCollectionToUnnest());
fieldLoads.add(new NestedSubplanToJoinRule());
fieldLoads.add(new InlineSubplanInputForNestedTupleSourceRule());
fieldLoads.add(new RemoveLeftOuterUnnestForLeftOuterJoinRule());
return fieldLoads;
}
use of org.apache.asterix.optimizer.rules.ConstantFoldingRule in project asterixdb by apache.
the class RuleCollections method buildPhysicalRewritesTopLevelRuleCollection.
public static final List<IAlgebraicRewriteRule> buildPhysicalRewritesTopLevelRuleCollection(ICcApplicationContext appCtx) {
List<IAlgebraicRewriteRule> physicalRewritesTopLevel = new LinkedList<>();
physicalRewritesTopLevel.add(new PushNestedOrderByUnderPreSortedGroupByRule());
physicalRewritesTopLevel.add(new CopyLimitDownRule());
// CopyLimitDownRule may generates non-topmost limits with numeric_adds functions.
// We are going to apply a constant folding rule again for this case.
physicalRewritesTopLevel.add(new ConstantFoldingRule(appCtx));
physicalRewritesTopLevel.add(new PushLimitIntoOrderByRule());
physicalRewritesTopLevel.add(new IntroduceProjectsRule());
physicalRewritesTopLevel.add(new SetAlgebricksPhysicalOperatorsRule());
physicalRewritesTopLevel.add(new IntroduceRapidFrameFlushProjectAssignRule());
physicalRewritesTopLevel.add(new SetExecutionModeRule());
physicalRewritesTopLevel.add(new IntroduceRandomPartitioningFeedComputationRule());
return physicalRewritesTopLevel;
}
Aggregations