julianhyde commented on a change in pull request #1896: 3877, 3892, 3814 and
3876
URL: https://github.com/apache/calcite/pull/1896#discussion_r403402673
##########
File path:
core/src/test/java/org/apache/calcite/rel/rel2sql/RelToSqlConverterTest.java
##########
@@ -2749,6 +2749,28 @@ private void checkLiteral2(String expression, String
expected) {
sql(query).ok(expected);
}
+ /** Test case for
+ * <a
href="https://issues.apache.org/jira/browse/CALCITE-3876">[CALCITE-3876]
+ * RelToSqlConverter should not combine Projects when top Project contains
+ * window function referencing window function from bottom Project</a>. */
+ @Test public void testWindowOnWindowDoesNotCombineProjects() {
+ final String query = "SELECT ROW_NUMBER() OVER (ORDER BY rn)\n"
+ + "FROM (SELECT *,\n"
+ + " ROW_NUMBER() OVER (ORDER BY \"product_id\") as rn\n"
Review comment:
I think `ROW_NUMBER` must have `ORDER BY` in its window, and if so, this
concern is moot.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services