tkalkirill commented on code in PR #5238:
URL: https://github.com/apache/calcite/pull/5238#discussion_r3923469199
##########
core/src/test/java/org/apache/calcite/test/SqlValidatorTest.java:
##########
@@ -15262,6 +15283,36 @@ private static SqlIdentifier
rewriteIdentifier(SqlIdentifier sqlIdentifier) {
}
}
+ /** Validator that simulates rewriting a ROWNUM predicate to FETCH. */
Review Comment:
I agree that a `Quidem` test would be preferable if it exercised this case.
However, standard Calcite SQL does not trigger the issue.
It occurs when an overridden `performUnconditionalRewrites` adds FETCH
directly to a `SqlSelect`, as in our downstream ROWNUM rewrite, before the
outer ORDER BY is processed.
`Quidem` uses the standard validator, so a regular SQL OFFSET/FETCH query
follows a different path and does not reproduce the bug. The custom validator
is needed to exercise this extension point, while the test itself still starts
from SQL.
--
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]