fsk119 commented on code in PR #21677:
URL: https://github.com/apache/flink/pull/21677#discussion_r1070749450


##########
flink-table/flink-sql-gateway/src/main/java/org/apache/flink/table/gateway/rest/handler/statement/FetchResultsHandler.java:
##########
@@ -63,17 +70,27 @@ protected CompletableFuture<FetchResultsResponseBody> 
handleRequest(
         OperationHandle operationHandle =
                 request.getPathParameter(OperationHandleIdPathParameter.class);
         Long token = 
request.getPathParameter(FetchResultsTokenPathParameter.class);
+        RowFormat rowFormat =
+                
request.getQueryParameter(FetchResultsRowFormatQueryParameter.class).get(0);

Review Comment:
   Does this throw exception if users don't specify query parameters



##########
flink-table/flink-sql-gateway/src/main/java/org/apache/flink/table/gateway/rest/message/statement/FetchResultsRowFormatQueryParameter.java:
##########
@@ -0,0 +1,49 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.table.gateway.rest.message.statement;
+
+import org.apache.flink.runtime.rest.messages.MessageQueryParameter;
+import org.apache.flink.table.gateway.rest.util.RowFormat;
+
+/**
+ * A {@link MessageQueryParameter} that parses the 'rowFormat' query parameter 
for fetching results.
+ */
+public class FetchResultsRowFormatQueryParameter extends 
MessageQueryParameter<RowFormat> {
+
+    public static final String KEY = "row_format";

Review Comment:
   row_format -> rowFormat



##########
flink-table/flink-sql-gateway/src/main/java/org/apache/flink/table/gateway/rest/serde/ResultInfo.java:
##########
@@ -47,20 +55,48 @@ public class ResultInfo {
     public static final String FIELD_NAME_KIND = "kind";
     public static final String FIELD_NAME_FIELDS = "fields";
 
+    // RowFormat
+    public static final String FIELD_NAME_ROW_FORMAT = "rowFormat";
+
     private final List<ColumnInfo> columnInfos;
     private final List<RowData> data;
+    private final RowFormat rowFormat;
 
-    public ResultInfo(List<ColumnInfo> columnInfos, List<RowData> data) {
+    public ResultInfo(List<ColumnInfo> columnInfos, List<RowData> data, 
RowFormat rowFormat) {
         this.columnInfos = columnInfos;
         this.data = data;
+        this.rowFormat = rowFormat;
     }
 
-    public static ResultInfo createResultInfo(ResultSet resultSet) {
+    public static ResultInfo createResultInfo(ResultSet resultSet, RowFormat 
rowFormat) {
+        if (resultSet == NOT_READY_RESULT) {

Review Comment:
   if resultSet.getResultType() == NotReady



-- 
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: issues-unsubscr...@flink.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to