libenchao commented on code in PR #3085:
URL: https://github.com/apache/calcite/pull/3085#discussion_r1125447145
##########
core/src/main/java/org/apache/calcite/rel/rel2sql/SqlImplementor.java:
##########
@@ -1791,6 +1791,14 @@ private boolean needNewSubQuery(
return false;
}
final Clause maxClause = Collections.max(clauses);
+
+ if (rel instanceof Project
+ && clauses.contains(Clause.ORDER_BY)
+ && dialect.getConformance().isSortByOrdinal()) {
Review Comment:
As mentioned in the Jira, if the sort-by-ordinal is not enabled, the result
is also incorrect. Could you also add a test case which shows that your fix
also cover it?
--
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]