lincoln-lil commented on code in PR #4739:
URL: https://github.com/apache/calcite/pull/4739#discussion_r2681890345
##########
core/src/test/java/org/apache/calcite/test/RelOptRulesTest.java:
##########
@@ -12059,4 +12059,31 @@ private void
checkLoptOptimizeJoinRule(LoptOptimizeJoinRule rule) {
.check();
}
+ @Test void testProjectToWindowRuleForNestedOver() {
+ HepProgramBuilder builder = new HepProgramBuilder();
+ builder.addRuleClass(ProjectToWindowRule.class);
+ HepPlanner hepPlanner = new HepPlanner(builder.build());
+ hepPlanner.addRule(CoreRules.PROJECT_TO_LOGICAL_PROJECT_AND_WINDOW);
+
+ final String sql =
+ "select deptno, f1, f2 from (select *, last_value(deptno) over
(order by empno) f2\n"
+ + "from (select *, first_value(deptno) over (order by empno) f1
from emp))\n";
+ sql(sql).withPlanner(hepPlanner)
+ .check();
+ }
+
+ @Test void testProjectToWindowRuleForMultiOver() {
Review Comment:
Since `LogicalWindow` does not currently print row type details, and this PR
does not aim to introduce such a larger change, this case is only for debugging
and confirmation.
--
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]