Dmitry Lychagin has posted comments on this change. Change subject: [ASTERIXDB-2233][COMP] Factor out common conjunct from disjunct ......................................................................
Patch Set 5: (12 comments) https://asterix-gerrit.ics.uci.edu/#/c/2322/5/asterixdb/asterix-app/src/test/resources/optimizerts/queries/tpch/q19_discounted_revenue.sqlpp File asterixdb/asterix-app/src/test/resources/optimizerts/queries/tpch/q19_discounted_revenue.sqlpp: Line 63: p_partkey: int64, remove trailing whitespace https://asterix-gerrit.ics.uci.edu/#/c/2322/5/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/condition/factor-common-conjunct/factor-common-conjunct.3.query.sqlpp File asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/condition/factor-common-conjunct/factor-common-conjunct.3.query.sqlpp: Line 29: {"a" : false, "b":false, "c":true}, remote trailing whitespace on both lines Line 37: where (a = b and b = c) or (a = b and c); let's add ORDER BY a,b,c https://asterix-gerrit.ics.uci.edu/#/c/2322/5/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/condition/minimum-disjunct/minimum-disjunct.3.query.sqlpp File asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/condition/minimum-disjunct/minimum-disjunct.3.query.sqlpp: Line 29: {"a" : false, "b":false, "c":true}, remove trailing whitespace on both lines Line 37: where (a and b) or (a and b and c); let's add ORDER BY a,b,c https://asterix-gerrit.ics.uci.edu/#/c/2322/5/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/condition/redundant-conjunct-expression/redundant-conjunct-expression.3.query.sqlpp File asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/condition/redundant-conjunct-expression/redundant-conjunct-expression.3.query.sqlpp: Line 29: {"a" : false, "b":false, "c":true}, remove trailing whitespace in both lines Line 37: where a and a; let's add ORDER BY a,b,c https://asterix-gerrit.ics.uci.edu/#/c/2322/5/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/condition/redundant-disjunct-expression/redundant-disjunct-expression.3.query.sqlpp File asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/condition/redundant-disjunct-expression/redundant-disjunct-expression.3.query.sqlpp: Line 29: {"a" : false, "b":false, "c":true}, remote trailing whitespace in both lines Line 37: where a or a; let's add ORDER BY a,b,c https://asterix-gerrit.ics.uci.edu/#/c/2322/5/hyracks-fullstack/algebricks/algebricks-rewriter/src/main/java/org/apache/hyracks/algebricks/rewriter/rules/AbstractConditionExpressionRule.java File hyracks-fullstack/algebricks/algebricks-rewriter/src/main/java/org/apache/hyracks/algebricks/rewriter/rules/AbstractConditionExpressionRule.java: Line 81: protected final List<Mutable<ILogicalExpression>> getDisjunctiveExpressions(Mutable<ILogicalExpression> exprRef) { only FactorCommonConjunctionFromDisjunctionRule uses this method, the other rule calls getFunctionExpresion direclty? Can we move into FactorCommonConjunctionFromDisjunctionRule ? Line 85: return EMPTY_EXPRESSION_LIST; can we just return 'null' and eliminate EMPTY_EXPRESSION_LIST constant? https://asterix-gerrit.ics.uci.edu/#/c/2322/5/hyracks-fullstack/algebricks/algebricks-rewriter/src/main/java/org/apache/hyracks/algebricks/rewriter/rules/InlineAndRemoveRedundantBooleanExpressionsRule.java File hyracks-fullstack/algebricks/algebricks-rewriter/src/main/java/org/apache/hyracks/algebricks/rewriter/rules/InlineAndRemoveRedundantBooleanExpressionsRule.java: Line 54: if (changed && function.getArguments().size() == 1) { I think we want to rewrite and(x) -> x , or(x) -> x even if "changed=false" at this point. Can we rearrange this code a bit? first transform the arguments, then if function is "and" or "or" run inlineCondition()/removeRedundantExpression() and if it has 1 argument then replace function expression with that argument. Does it make sense? -- To view, visit https://asterix-gerrit.ics.uci.edu/2322 To unsubscribe, visit https://asterix-gerrit.ics.uci.edu/settings Gerrit-MessageType: comment Gerrit-Change-Id: I97fe7d94276f9206c076ca94814b2fa794107859 Gerrit-PatchSet: 5 Gerrit-Project: asterixdb Gerrit-Branch: master Gerrit-Owner: Wail Alkowaileet <[email protected]> Gerrit-Reviewer: Ali Alsuliman <[email protected]> Gerrit-Reviewer: Anon. E. Moose #1000171 Gerrit-Reviewer: Dmitry Lychagin <[email protected]> Gerrit-Reviewer: Jenkins <[email protected]> Gerrit-HasComments: Yes
