lincoln-lil commented on code in PR #4744:
URL: https://github.com/apache/calcite/pull/4744#discussion_r2692590830


##########
core/src/test/java/org/apache/calcite/test/RelOptRulesTest.java:
##########
@@ -502,6 +502,24 @@ private HepProgram createHypergraphProgram() {
         .checkUnchanged();
   }
 
+  /**
+   * Test case for <a 
href="https://issues.apache.org/jira/projects/CALCITE/issues/CALCITE-7375";>
+   * [CALCITE-7375] ProjectWindowTransposeRule does not correctly adjust 
column indices in window
+   * bounds</a>. */
+  @Test void testNestedConstantWindow() {
+    final String sql =
+            "select deptno, f1, f2 from (\n"
+            + "select *, last_value(deptno) over"
+            + "  (order by empno ROWS BETWEEN 2 PRECEDING AND 1 FOLLOWING) 
f2\n"
+            + "from (\n"
+            + "  select *, first_value(deptno) over "
+            + "    (order by empno ROWS BETWEEN 2 PRECEDING AND 1 FOLLOWING) 
f1 from emp))\n";

Review Comment:
   Preview:
   ```
         <![CDATA[WITH t1 AS (
     SELECT *,
            FIRST_VALUE(deptno) OVER (
              ORDER BY empno
              ROWS BETWEEN 2 PRECEDING AND 1 FOLLOWING
            ) AS f1
     FROM emp
   )
   SELECT deptno,
          f1,
          LAST_VALUE(deptno) OVER (
            ORDER BY empno
            ROWS BETWEEN 2 PRECEDING AND 1 FOLLOWING
          ) AS f2
   FROM t1]]>
   ```



-- 
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]

Reply via email to