yuzelin commented on code in PR #20790: URL: https://github.com/apache/flink/pull/20790#discussion_r976003878
########## flink-connectors/flink-connector-hive/src/test/java/org/apache/flink/table/endpoint/hive/HiveServer2EndpointITCase.java: ########## @@ -572,6 +595,107 @@ public void testGetInfo() throws Exception { } } + @Test + public void testExecuteStatementInSyncMode() throws Exception { + TCLIService.Client client = createClient(); + TSessionHandle sessionHandle = client.OpenSession(new TOpenSessionReq()).getSessionHandle(); + TOperationHandle operationHandle = + client.ExecuteStatement(new TExecuteStatementReq(sessionHandle, "SHOW CATALOGS")) + .getOperationHandle(); + + assertThat( + client.GetOperationStatus(new TGetOperationStatusReq(operationHandle)) + .getOperationState()) + .isEqualTo(TOperationState.FINISHED_STATE); + + RowSet rowSet = + RowSetFactory.create( + client.FetchResults( + new TFetchResultsReq( + operationHandle, + TFetchOrientation.FETCH_NEXT, + Integer.MAX_VALUE)) + .getResults(), + HIVE_CLI_SERVICE_PROTOCOL_V10); + Iterator<Object[]> iterator = rowSet.iterator(); + List<List<Object>> actual = new ArrayList<>(); + while (iterator.hasNext()) { + actual.add(new ArrayList<>(Arrays.asList(iterator.next()))); + } + assertThat(actual).isEqualTo(Collections.singletonList(Collections.singletonList("hive"))); + } Review Comment: Is it necessary to call client.CloseSession? -- 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