public final static List<IAlgebraicRewriteRule> buildNormalizationRuleCollection() { List<IAlgebraicRewriteRule> normalization = new LinkedList<IAlgebraicRewriteRule>(); normalization.add(new EliminateSubplanRule()); normalization.add(new BreakSelectIntoConjunctsRule()); normalization.add(new PushSelectIntoJoinRule()); normalization.add(new ExtractGbyExpressionsRule()); return normalization; }
pushOps(pushedOnEither, joinBranchLeftRef, context); } else { pushOps(pushedOnEither, joinBranchRightRef, context); pushOps(pushedOnLeft, joinBranchLeftRef, context); pushOps(pushedOnRight, joinBranchRightRef, context); addCondToJoin(select, join, context); } else { // push down Iterator<Mutable<ILogicalOperator>> branchIter = join.getInputs().iterator(); if (j > 0 && isLoj && containsNotMissingFiltering(selectCondition)) { lojToInner = true; if ((j > 0 && isLoj) && containsMissingFiltering(selectCondition)) { copySelectToBranch(select, branch, context);
/** * Whether the expression contains a missing filtering * * @param expr * @return true if the expression contains a missing filtering function call; false otherwise. */ private boolean containsMissingFiltering(ILogicalExpression expr) { if (expr.getExpressionTag() != LogicalExpressionTag.FUNCTION_CALL) { return false; } ScalarFunctionCallExpression func = (ScalarFunctionCallExpression) expr; if (func.getFunctionIdentifier() == AlgebricksBuiltinFunctions.AND) { for (Mutable<ILogicalExpression> argumentRef : func.getArguments()) { if (containsMissingFiltering(argumentRef.getValue())) { return true; } } return false; } if (func.getFunctionIdentifier() != AlgebricksBuiltinFunctions.IS_MISSING) { return false; } return true; } }
if (func.getFunctionIdentifier() == AlgebricksBuiltinFunctions.AND) { for (Mutable<ILogicalExpression> argumentRef : func.getArguments()) { if (containsNotMissingFiltering(argumentRef.getValue())) { return true;
public static final List<IAlgebraicRewriteRule> buildFuzzyJoinRuleCollection() { List<IAlgebraicRewriteRule> fuzzy = new LinkedList<>(); fuzzy.add(new FuzzyJoinRule()); fuzzy.add(new ExtractCommonExpressionsRule()); fuzzy.add(new NestedSubplanToJoinRule()); fuzzy.add(new PushSelectIntoJoinRule()); fuzzy.add(new RemoveUnusedAssignAndAggregateRule()); fuzzy.add(new InlineSubplanInputForNestedTupleSourceRule()); fuzzy.add(new RemoveRedundantVariablesRule()); fuzzy.add(new AsterixInlineVariablesRule()); fuzzy.add(new RemoveUnusedAssignAndAggregateRule()); return fuzzy; }
/** * 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; }
/** * 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; }
condPushDownAndJoinInference.add(new ComplexUnnestToProductRule()); condPushDownAndJoinInference.add(new DisjunctivePredicateToJoinRule()); condPushDownAndJoinInference.add(new PushSelectIntoJoinRule()); condPushDownAndJoinInference.add(new IntroJoinInsideSubplanRule());