lincoln-lil commented on code in PR #4744:
URL: https://github.com/apache/calcite/pull/4744#discussion_r2692588644
##########
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:
Thanks for the suggestion! The nested query with complex OVER window
definitions is not very readable, so I rewrote it using a CTE and added more
formatting and line breaks.
--
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]