You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@calcite.apache.org by GitBox <gi...@apache.org> on 2021/01/13 18:51:58 UTC

[GitHub] [calcite] amaliujia commented on a change in pull request #2324: push "unparse offset and fetch" process logic to specific dialect

amaliujia commented on a change in pull request #2324:
URL: https://github.com/apache/calcite/pull/2324#discussion_r556754061



##########
File path: core/src/main/java/org/apache/calcite/sql/SqlOrderBy.java
##########
@@ -97,26 +97,10 @@ private Operator() {
         writer.list(SqlWriter.FrameTypeEnum.ORDER_BY_LIST, SqlWriter.COMMA,
             orderBy.orderList);
       }
-      if (orderBy.offset != null) {
-        final SqlWriter.Frame frame2 =
-            writer.startList(SqlWriter.FrameTypeEnum.OFFSET);
-        writer.newlineAndIndent();
-        writer.keyword("OFFSET");
-        orderBy.offset.unparse(writer, -1, -1);
-        writer.keyword("ROWS");
-        writer.endList(frame2);
-      }
-      if (orderBy.fetch != null) {
-        final SqlWriter.Frame frame3 =
-            writer.startList(SqlWriter.FrameTypeEnum.FETCH);
-        writer.newlineAndIndent();
-        writer.keyword("FETCH");
-        writer.keyword("NEXT");
-        orderBy.fetch.unparse(writer, -1, -1);
-        writer.keyword("ROWS");
-        writer.keyword("ONLY");
-        writer.endList(frame3);
+      if (orderBy.offset != null || orderBy.fetch != null) {
+        writer.getDialect().unparseOffsetFetch(writer, orderBy.offset, orderBy.fetch);
       }
+

Review comment:
       Please undo this line of change :-)




----------------------------------------------------------------
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:
users@infra.apache.org