You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by "AMashenkov (via GitHub)" <gi...@apache.org> on 2024/04/04 11:05:15 UTC
[PR] IGNITE-21580 Sql. Optimise query plans when using two phase aggregates [ignite-3]
AMashenkov opened a new pull request, #3552:
URL: https://github.com/apache/ignite-3/pull/3552
https://issues.apache.org/jira/browse/IGNITE-21580
Thank you for submitting the pull request.
To streamline the review process of the patch and ensure better code quality
we ask both an author and a reviewer to verify the following:
### The Review Checklist
- [ ] **Formal criteria:** TC status, codestyle, mandatory documentation. Also make sure to complete the following:
\- There is a single JIRA ticket related to the pull request.
\- The web-link to the pull request is attached to the JIRA ticket.
\- The JIRA ticket has the Patch Available state.
\- The description of the JIRA ticket explains WHAT was made, WHY and HOW.
\- The pull request title is treated as the final commit message. The following pattern must be used: IGNITE-XXXX Change summary where XXXX - number of JIRA issue.
- [ ] **Design:** new code conforms with the design principles of the components it is added to.
- [ ] **Patch quality:** patch cannot be split into smaller pieces, its size must be reasonable.
- [ ] **Code quality:** code is clean and readable, necessary developer documentation is added if needed.
- [ ] **Tests code quality:** test set covers positive/negative scenarios, happy/edge cases. Tests are effective in terms of execution time and resources.
### Notes
- [Apache Ignite Coding Guidelines](https://cwiki.apache.org/confluence/display/IGNITE/Java+Code+Style+Guide)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] IGNITE-21580 Sql. Optimise query plans when using two phase aggregates [ignite-3]
Posted by "AMashenkov (via GitHub)" <gi...@apache.org>.
AMashenkov merged PR #3552:
URL: https://github.com/apache/ignite-3/pull/3552
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] IGNITE-21580 Sql. Optimise query plans when using two phase aggregates [ignite-3]
Posted by "korlov42 (via GitHub)" <gi...@apache.org>.
korlov42 commented on code in PR #3552:
URL: https://github.com/apache/ignite-3/pull/3552#discussion_r1553501013
##########
modules/sql-engine/src/test/java/org/apache/ignite/internal/sql/engine/planner/MapReduceHashAggregatePlannerTest.java:
##########
@@ -141,22 +141,23 @@ public void distinctAggregateWithGroups() throws Exception {
checkDistinctAggWithGroupBySingle(TestCase.CASE_7_2);
checkDistinctAggWithGroupBySingle(TestCase.CASE_7_3);
+ // TODO REMOVE TODO and close ticket
Review Comment:
don't forget to remove this TODO as well
##########
modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/metadata/IgniteMdDistinctRowCount.java:
##########
@@ -44,14 +55,25 @@ public Double getDistinctRowCount(
ImmutableBitSet groupKey,
RexNode predicate
) {
- if (groupKey.cardinality() == 0) {
- return 1d;
+ RelNode best = rel.getBest();
+ if (best != null) {
+ return mq.getDistinctRowCount(best, groupKey, predicate);
}
- double rowCount = mq.getRowCount(rel);
-
- rowCount *= 1.0 - Math.pow(.5, groupKey.cardinality());
+ if (rel.getConvention() == Convention.NONE) {
Review Comment:
why do we skip logical relations?
##########
modules/sql-engine/src/testFixtures/java/org/apache/ignite/internal/sql/engine/util/tpch/TpchHelper.java:
##########
@@ -65,6 +65,32 @@ public static String getQuery(String queryId) {
}
}
+ /**
+ * Loads query plan for provided TPC-H query id.
+ *
+ * @see #getQuery(String) for query id details.
+ */
+ public static String getQueryPlan(String queryId) {
Review Comment:
it's better to move this as utility method to the test class. The problem is plan belongs to a test resource of sql-engine test jar, not test-fixture jar. Thus, in order to get plan, you have to add test to a dependency alongside with reps to text-fixture, otherwise you will get `java.lang.IllegalArgumentException: Resource does not exist` exception
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org