Skip to content

Commit

Permalink
Address review comments linking test artifacts to JIRA
Browse files Browse the repository at this point in the history
  • Loading branch information
ian.bertolacci committed Sep 10, 2024
1 parent 6329408 commit 64348b2
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -3770,6 +3770,10 @@ void checkCorrelatedMapSubQuery(boolean expand) {
sql(sql).withExpand(false).withDecorrelate(false).ok();
}

/** Test case for
* <a href="https://issues.apache.org/jira/browse/CALCITE-6554">[CALCITE-6554]
* Nested correlated sub-query in aggregation does not have inner correlation variable bound
* to inner projection</a>. */
@Test void testCorrelationInProjectionWith1xNestedCorrelatedProjection() {
final String sql = "select e1.empno,\n"
+ " (select sum(e2.sal +\n"
Expand All @@ -3779,6 +3783,10 @@ void checkCorrelatedMapSubQuery(boolean expand) {
sql(sql).withExpand(false).withDecorrelate(false).ok();
}

/** Test case for
* <a href="https://issues.apache.org/jira/browse/CALCITE-6554">[CALCITE-6554]
* Nested correlated sub-query in aggregation does not have inner correlation variable bound
* to inner projection</a>. */
@Test void testCorrelationInProjectionWith2xNestedCorrelatedProjection() {
final String sql = "select e1.empno,\n"
+ " (select sum(e2.sal +\n"
Expand All @@ -3789,6 +3797,10 @@ void checkCorrelatedMapSubQuery(boolean expand) {
sql(sql).withExpand(false).withDecorrelate(false).ok();
}

/** Test case for
* <a href="https://issues.apache.org/jira/browse/CALCITE-6554">[CALCITE-6554]
* Nested correlated sub-query in aggregation does not have inner correlation variable bound
* to inner projection</a>. */
@Test void testCorrelationInProjectionWithCorrelatedProjectionWithNestedNonCorrelatedSubquery() {
final String sql = "select e1.empno,\n"
+ " (select sum(e2.sal +\n"
Expand Down
2 changes: 1 addition & 1 deletion core/src/test/resources/sql/sub-query.iq
Original file line number Diff line number Diff line change
Expand Up @@ -668,7 +668,7 @@ FROM (SELECT 1 AS a) AS t;

!ok

# [CALCITE-6554] Nested correlated subqueries
# [CALCITE-6554] nested correlated sub-query in aggregation does not have inner correlation variable bound to inner projection
SELECT ename,
(SELECT Sum(sal + COALESCE((SELECT Sum(sal) FROM "scott".emp AS subord2
WHERE
Expand Down

0 comments on commit 64348b2

Please sign in to comment.