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


##########
flink-table/flink-sql-gateway-api/src/main/java/org/apache/flink/table/gateway/api/SqlGatewayService.java:
##########
@@ -108,6 +120,16 @@ void closeOperation(SessionHandle sessionHandle, 
OperationHandle operationHandle
     OperationInfo getOperationInfo(SessionHandle sessionHandle, 
OperationHandle operationHandle)
             throws SqlGatewayException;
 
+    /**
+     * Get the result schema for the specified Operation.
+     *
+     * @param sessionHandle handle to identify the session.
+     * @param operationHandle handle to identify the operation.
+     */
+    ResolvedSchema getOperationResultSchema(

Review Comment:
   The SQL Operation allows ueser to fetch schema when it is in the RUNNING or 
FINISHED state. But because of the Operation Lock, the GetResultSetMetadata 
(needs to get the lock before execution) is only able to get the schema when 
the Operation is FINISHED. 
   
   The 
[HiveStatement](https://github.com/apache/hive/blob/b76c64024ac340c7a1d764f68bac15501b2bc8d6/jdbc/src/java/org/apache/hive/jdbc/HiveStatement.java#L294)
 fetches the schema until the result is ready.
   
   I just wonder whether it's better we block the request until the schema is 
available.



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