WencongLiu commented on code in PR #20451:
URL: https://github.com/apache/flink/pull/20451#discussion_r939503076


##########
flink-table/flink-sql-gateway/src/main/java/org/apache/flink/table/gateway/rest/message/statement/FetchResultsResponseBody.java:
##########
@@ -0,0 +1,75 @@
+/*
+ * 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.ResponseBody;
+import org.apache.flink.table.gateway.api.results.ExceptionInfo;
+import org.apache.flink.table.gateway.api.results.ResultSet;
+
+import 
org.apache.flink.shaded.jackson2.com.fasterxml.jackson.annotation.JsonInclude;
+import 
org.apache.flink.shaded.jackson2.com.fasterxml.jackson.annotation.JsonProperty;
+
+/** {@link ResponseBody} for execute a statement. */
+@JsonInclude(JsonInclude.Include.NON_NULL)
+public class FetchResultsResponseBody implements ResponseBody {
+
+    private static final String FIELD_RESULT_TYPE = "result_type";
+    private static final String FIELD_RESULTS = "results";
+    private static final String FIELD_NEXT_RESULT_URI = "next_result_uri";
+    private static final String FIELD_EXCEPTION = "exception";
+
+    @JsonProperty(FIELD_RESULTS)
+    private final ResultSet results;
+
+    @JsonProperty(FIELD_RESULT_TYPE)
+    private final String resultType;
+
+    @JsonProperty(FIELD_NEXT_RESULT_URI)
+    private final String nextResultUri;
+
+    @JsonProperty(FIELD_EXCEPTION)
+    private final ExceptionInfo exceptionInfo;

Review Comment:
   These two fields should not be nullable.
   If there is no more data,  `nextResultUri ` should be an empty string `""`.
   If there is no exception throwed, all fields in 'exceptionInfo' should be 
null.
   The content of these two field in the  response will be 
   
   "next_result_uri": "".
       "exception": {
         "root_cause": null,
         "exception_stack": null 
      }
   
   
   
   
   



-- 
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]

Reply via email to