chunweilei commented on a change in pull request #1186: [CALCITE-3003]
AssertionError when GROUP BY nested field
URL: https://github.com/apache/calcite/pull/1186#discussion_r279332118
##########
File path:
core/src/test/java/org/apache/calcite/test/SqlToRelConverterTest.java
##########
@@ -2679,6 +2679,66 @@ public void testSelectNestedColumnType() {
sql(sql).ok();
}
+ /**
+ * Test case for <a
href="https://issues.apache.org/jira/browse/CALCITE-3003">[CALCITE-3003]
+ * AssertionError when GROUP BY nested field</a>.
+ */
+ @Test
+ public void testGroupByNestedColumn() {
+ final String sql =
+ "select\n"
+ + " coord.x,\n"
+ + " coord_ne.sub.a,\n"
+ + " avg(coord.y)\n"
+ + "from\n"
+ + " customer.contact_peek\n"
+ + "group by\n"
+ + " coord_ne.sub.a,\n"
+ + " coord.x";
+ sql(sql).ok();
+ }
+
+ /**
+ * Test case for <a
href="https://issues.apache.org/jira/browse/CALCITE-3003">[CALCITE-3003]
+ * AssertionError when GROUP BY nested field</a>.
+ */
+ @Test
+ public void testGroupingSetsWithNestedColumn() {
+ final String sql =
+ "select\n"
+ + " coord.x,\n"
+ + " coord.\"unit\",\n"
+ + " coord_ne.sub.a,\n"
+ + " avg(coord.y)\n"
+ + "from\n"
+ + " customer.contact_peek\n"
+ + "group by\n"
+ + " grouping sets (\n"
+ + " (coord_ne.sub.a, coord.x, coord.\"unit\"),\n"
+ + " (coord.x, coord.\"unit\")\n"
+ + " )";
+ sql(sql).ok();
+ }
+
+ /**
+ * Test case for <a
href="https://issues.apache.org/jira/browse/CALCITE-3003">[CALCITE-3003]
+ * AssertionError when GROUP BY nested field</a>.
+ */
+ @Test
Review comment:
you can use `/** Similar to {@link #testGroupByNestedColumn()}. */` instead
of repeating the JIRA case URL every time. Meanwhile concisely describe what
particular conditions the case is targeting.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services