zstan commented on code in PR #1456:
URL: https://github.com/apache/ignite-3/pull/1456#discussion_r1058098193
##########
modules/sql-engine/src/test/java/org/apache/ignite/internal/sql/engine/planner/AggregatePlannerTest.java:
##########
@@ -372,6 +373,63 @@ public void colocated(AggregateAlgorithm algo) throws
Exception {
algo.rulesToDisable);
}
+ /**
+ * Check that map aggregate does not contain distinct accumulator.
+ *
+ * @throws Exception If failed.
+ */
+ @Test
+ public void mapAggregateWithoutDistinctAcc() throws Exception {
+ TestTable tbl = createAffinityTable("TEST");
+
+ IgniteSchema publicSchema = new IgniteSchema("PUBLIC");
+
+ 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 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.
+ *
+ * @param sql Request string.
+ * @param publicSchema Schema.
+ * @throws Exception If failed.
+ */
+ private void checkDistinctInMapAggNode(String sql, IgniteSchema
publicSchema) throws Exception {
+ String[][] disabledRules = new String[][] {{""},
{"MapReduceHashAggregateConverterRule"},
Review Comment:
discussed in messenger, will be change a bit.
--
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]