ViggoC commented on code in PR #2631:
URL: https://github.com/apache/calcite/pull/2631#discussion_r2151204247
##########
core/src/test/java/org/apache/calcite/test/SqlToRelConverterTest.java:
##########
@@ -286,6 +286,57 @@ public static void checkActualAndReferenceFiles() {
sql(sql).ok();
}
+ /** Test case for
+ * <a
href="https://issues.apache.org/jira/browse/CALCITE-4915">[CALCITE-4915]
+ * Query with unqualified common column and NATURAL JOIN fails</a>. */
+ @Test void testJoinNaturalWithUnqualifiedCommonColumn() {
+ final String sql = "SELECT deptno, name\n"
+ + "FROM emp\n"
+ + "NATURAL JOIN dept";
+ sql(sql).ok();
+ }
+
+ /** Similar to {@link #testJoinNaturalWithUnqualifiedCommonColumn()},
+ * but with nested common column. */
+ @Test void testJoinNaturalWithUnqualifiedNestedCommonColumn() {
+ final String sql =
+ "select (coord).x\n"
+ + "from customer.contact_peek t1\n"
+ + "natural join customer.contact_peek t2";
+ sql(sql).ok();
+ }
+
+ /** Similar to {@link #testJoinNaturalWithUnqualifiedCommonColumn()},
+ * but with aggregate. */
+ @Test void testJoinNaturalWithAggregate() {
+ final String sql = "select deptno, count(*)\n"
+ + "from emp\n"
+ + "natural join dept\n"
+ + "group by deptno";
+ sql(sql).ok();
+ }
+
+ /** Similar to {@link #testJoinNaturalWithUnqualifiedCommonColumn()},
+ * but with grouping sets. */
+ @Test void testJoinNaturalWithGroupingSets() {
+ final String sql = "select deptno, grouping(deptno),\n"
+ + "grouping(deptno, job), count(*)\n"
+ + "from emp\n"
+ + "natural join dept\n"
+ + "group by grouping sets ((deptno), (deptno, job))";
+ sql(sql).ok();
+ }
+
+ /** Similar to {@link #testJoinNaturalWithUnqualifiedCommonColumn()},
+ * but with multiple join. */
+ @Test void testJoinNaturalWithMultipleJoin() {
Review Comment:
This test case failed after rebasing master.
--
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]