public final static List<IAlgebraicRewriteRule> buildOpPushDownRuleCollection() { List<IAlgebraicRewriteRule> opPushDown = new LinkedList<IAlgebraicRewriteRule>(); opPushDown.add(new PushProjectDownRule()); opPushDown.add(new PushSelectDownRule()); return opPushDown; }
public final static List<IAlgebraicRewriteRule> buildCondPushDownRuleCollection() { List<IAlgebraicRewriteRule> condPushDown = new LinkedList<IAlgebraicRewriteRule>(); condPushDown.add(new PushSelectDownRule()); condPushDown.add(new InlineVariablesRule()); condPushDown.add(new FactorRedundantGroupAndDecorVarsRule()); condPushDown.add(new EliminateSubplanRule()); return condPushDown; }
/** * When a nested data sources exist, convert the plan to use the join operator. * * @return List of algebraic rewrite rules. */ public final static List<IAlgebraicRewriteRule> buildNestedDataSourceRuleCollection() { List<IAlgebraicRewriteRule> xquery = new LinkedList<IAlgebraicRewriteRule>(); xquery.add(new BreakSelectIntoConjunctsRule()); xquery.add(new SimpleUnnestToProductRule()); xquery.add(new PushMapOperatorDownThroughProductRule()); xquery.add(new PushSubplanWithAggregateDownThroughProductRule()); xquery.add(new PushSelectDownRule()); xquery.add(new PushSelectIntoJoinRule()); // Clean up xquery.add(new RemoveRedundantVariablesRule()); xquery.add(new RemoveUnusedAssignAndAggregateRule()); return xquery; }
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 InjectTypeCastForFunctionArgumentsRule()); 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; }
/** * Unnest more complex structures. * * @return List of algebraic rewrite rules. */ public final static List<IAlgebraicRewriteRule> buildUnnestingRuleCollection() { List<IAlgebraicRewriteRule> xquery = new LinkedList<IAlgebraicRewriteRule>(); xquery.add(new PushSelectDownRule()); xquery.add(new SimpleUnnestToProductRule()); xquery.add(new ComplexUnnestToProductRule()); xquery.add(new ComplexJoinInferenceRule()); xquery.add(new PushSelectIntoJoinRule()); xquery.add(new IntroJoinInsideSubplanRule()); xquery.add(new PushMapOperatorDownThroughProductRule()); xquery.add(new PushSubplanWithAggregateDownThroughProductRule()); xquery.add(new IntroduceGroupByForSubplanRule()); xquery.add(new SubplanOutOfGroupRule()); xquery.add(new InsertOuterJoinRule()); xquery.add(new ExtractFunctionsFromJoinConditionRule()); xquery.add(new RemoveRedundantVariablesRule()); xquery.add(new RemoveUnusedAssignAndAggregateRule()); xquery.add(new FactorRedundantGroupAndDecorVarsRule()); xquery.add(new EliminateSubplanRule()); xquery.add(new EliminateGroupByEmptyKeyRule()); xquery.add(new PushSubplanIntoGroupByRule()); xquery.add(new NestedSubplanToJoinRule()); xquery.add(new EliminateSubplanWithInputCardinalityOneRule()); return xquery; }
public static final List<IAlgebraicRewriteRule> buildCondPushDownAndJoinInferenceRuleCollection() { List<IAlgebraicRewriteRule> condPushDownAndJoinInference = new LinkedList<>(); condPushDownAndJoinInference.add(new PushSelectDownRule()); condPushDownAndJoinInference.add(new PushSortDownRule()); condPushDownAndJoinInference.add(new RemoveRedundantListifyRule());