AMashenkov commented on code in PR #1524:
URL: https://github.com/apache/ignite-3/pull/1524#discussion_r1073311278
##########
modules/sql-engine/src/test/java/org/apache/ignite/internal/sql/engine/planner/AggregatePlannerTest.java:
##########
@@ -389,52 +390,45 @@ public void mapAggregateWithoutDistinctAcc() throws
Exception {
publicSchema.addTable(tbl);
- // TODO: https://issues.apache.org/jira/browse/IGNITE-18464 Colocated
sort aggregates need to compose a plans with additional sort
- //checkDistinctInMapAggNode("SELECT COUNT(DISTINCT val0) FROM test",
publicSchema);
- //checkDistinctInMapAggNode("SELECT AVG(DISTINCT val0) FROM test",
publicSchema);
- //checkDistinctInMapAggNode("SELECT SUM(DISTINCT val0) FROM test",
publicSchema);
- //checkDistinctInMapAggNode("SELECT MIN(DISTINCT val0) FROM test",
publicSchema);
- //checkDistinctInMapAggNode("SELECT MAX(DISTINCT val0) FROM test",
publicSchema);
-
- checkDistinctInMapAggNode("SELECT COUNT(DISTINCT val0) FROM test GROUP
BY val1", publicSchema);
+ checkDistinctInMapAggNode("SELECT COUNT(*) FROM test", publicSchema);
+ checkDistinctInMapAggNode("SELECT COUNT(DISTINCT val0) FROM test",
publicSchema);
+ checkDistinctInMapAggNode("SELECT AVG(DISTINCT val0) FROM test",
publicSchema);
+ checkDistinctInMapAggNode("SELECT SUM(DISTINCT val0) FROM test",
publicSchema);
+ checkDistinctInMapAggNode("SELECT MIN(DISTINCT val0) FROM test",
publicSchema);
+ checkDistinctInMapAggNode("SELECT MAX(DISTINCT val0) FROM test",
publicSchema);
+ checkDistinctInMapAggNode("SELECT COUNT(DISTINCT val0) FROM test GROUP
BY val1, grp0", publicSchema);
checkDistinctInMapAggNode("SELECT val1, COUNT(DISTINCT val0) as v1
FROM test GROUP BY val1", publicSchema);
-
checkDistinctInMapAggNode("SELECT AVG(DISTINCT val0) FROM test GROUP
BY val1", publicSchema);
-
checkDistinctInMapAggNode("SELECT SUM(DISTINCT val0) FROM test GROUP
BY val1", publicSchema);
-
checkDistinctInMapAggNode("SELECT MIN(DISTINCT val0) FROM test GROUP
BY val1", publicSchema);
-
checkDistinctInMapAggNode("SELECT MAX(DISTINCT val0) FROM test GROUP
BY val1", publicSchema);
-
checkDistinctInMapAggNode("SELECT val0 FROM test WHERE VAL1 =
ANY(SELECT DISTINCT val1 FROM test)", publicSchema);
}
/**
- * Check that plan does not contain distinct accumulators on map nodes.
+ * Check that plan does not contain distinct accumulators on map nodes
with additional expectations.
*
* @param sql Request string.
* @param publicSchema Schema.
* @throws Exception If failed.
*/
private void checkDistinctInMapAggNode(String sql, IgniteSchema
publicSchema) throws Exception {
- List<Pair<String[], Boolean>> disabledRules = List.of(new Pair<>(new
String[]{""}, false),
- new Pair<>(new String[]{"ColocatedHashAggregateConverterRule",
"ColocatedSortAggregateConverterRule"}, true),
+ log.info("++check: " + sql);
+ List<Pair<String[], Predicate<IgniteRel>>> disabledRules = List.of(
new Pair<>(new String[]{"ColocatedHashAggregateConverterRule",
"ColocatedSortAggregateConverterRule",
- "MapReduceSortAggregateConverterRule"}, true),
- new Pair<>(new String[]{"ColocatedHashAggregateConverterRule",
"ColocatedSortAggregateConverterRule",
- "MapReduceHashAggregateConverterRule"}, true)
+ "MapReduceSortAggregateConverterRule"}, node ->
!findNodes(node, byClass(IgniteMapAggregateBase.class)).isEmpty()),
+ new Pair<>(new String[]{"MapReduceHashAggregateConverterRule",
"MapReduceSortAggregateConverterRule",
+ "ColocatedHashAggregateConverterRule"}, node -> true),
+ new Pair<>(new String[]{"MapReduceHashAggregateConverterRule",
"MapReduceSortAggregateConverterRule",
+ "ColocatedSortAggregateConverterRule"}, node -> true)
);
- for (Pair<String[], Boolean> rules : disabledRules) {
+ for (Pair<String[], Predicate<IgniteRel>> rules : disabledRules) {
+ log.info("+++disable rules: " + Arrays.toString(rules.getFirst()));
Review Comment:
```suggestion
```
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]