yuzelin commented on code in PR #20401:
URL: https://github.com/apache/flink/pull/20401#discussion_r938483915


##########
flink-connectors/flink-connector-hive/src/main/java/org/apache/flink/table/endpoint/hive/HiveServer2Endpoint.java:
##########
@@ -422,7 +426,76 @@ public TGetCatalogsResp GetCatalogs(TGetCatalogsReq 
tGetCatalogsReq) throws TExc
 
     @Override
     public TGetSchemasResp GetSchemas(TGetSchemasReq tGetSchemasReq) throws 
TException {
-        throw new UnsupportedOperationException(ERROR_MESSAGE);
+        TGetSchemasResp resp = new TGetSchemasResp();
+        try {
+            SessionHandle sessionHandle = 
toSessionHandle(tGetSchemasReq.getSessionHandle());
+            OperationHandle operationHandle =
+                    service.submitOperation(
+                            sessionHandle,
+                            OperationType.LIST_SCHEMAS,
+                            () -> {
+                                Set<String> schemaNames =
+                                        service
+                                                .listDatabases(
+                                                        sessionHandle,
+                                                        
tGetSchemasReq.getCatalogName())

Review Comment:
   1. Add SqlGatewayService#getCurrentCatalog & test case.
   2. Add null check for catalogName, and, if null, set catalogName = 
getCurrentCatalog.



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