Wail Alkowaileet has posted comments on this change. Change subject: [ASTERIXDB-2233][COMP] Factor out common conjunct from disjunct ......................................................................
Patch Set 7: (11 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 Done 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 Done Line 37: where (a = b and b = c) or (a = b and c) > let's add ORDER BY a,b,c Done 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 Done Line 37: where a and a > let's add ORDER BY a,b,c Done 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 Done Line 37: where a or a > let's add ORDER BY a,b,c Done 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: * @param condRef > only FactorCommonConjunctionFromDisjunctionRule uses this method, the other Done Line 85: * {@code <code>false</code>} otherwise. > can we just return 'null' and eliminate EMPTY_EXPRESSION_LIST constant? I did this because sonar was complaining. Now it returns null and added NOSONAR. https://asterix-gerrit.ics.uci.edu/#/c/2322/6/hyracks-fullstack/algebricks/algebricks-rewriter/src/main/java/org/apache/hyracks/algebricks/rewriter/rules/FactorCommonConjunctionFromDisjunctionRule.java File hyracks-fullstack/algebricks/algebricks-rewriter/src/main/java/org/apache/hyracks/algebricks/rewriter/rules/FactorCommonConjunctionFromDisjunctionRule.java: PS6, Line 49: if (disjunctExprs.size() == 1) { : condRef.setValue(disjunctExprs.get(0).getValue()); : } Similarly, I moved this inside the if statement. 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: changed |= inlineCondititon(function); > I think we want to rewrite and(x) -> x , or(x) -> x even if "changed=false" Sure... Now it looks cleaner :) Thank! -- 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: 7 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-Reviewer: Wail Alkowaileet <[email protected]> Gerrit-HasComments: Yes
