WencongLiu commented on code in PR #20609:
URL: https://github.com/apache/flink/pull/20609#discussion_r953374948
##########
flink-end-to-end-tests/flink-sql-gateway-test/src/test/java/org/apache/flink/table/gateway/SqlGatewayE2ECase.java:
##########
@@ -117,8 +119,13 @@ public void testExecuteStatement() throws Exception {
.setClientMode(SQLJobSubmission.ClientMode.HIVE_JDBC)
.build(),
Duration.ofSeconds(60));
+ gateway.submitSQLJob(
+ new SQLJobSubmission.SQLJobSubmissionBuilder(lines)
+ .setClientMode(SQLJobSubmission.ClientMode.REST)
+ .build(),
+ Duration.ofSeconds(60));
}
Review Comment:
Done. There are both `testHiveserver2ExecuteStatement` and
`testRestExecuteStatement` currently.
##########
flink-end-to-end-tests/flink-end-to-end-tests-common/src/main/java/org/apache/flink/tests/util/flink/FlinkDistribution.java:
##########
@@ -301,7 +309,105 @@ public void submitSQLJob(SQLJobSubmission job, Duration
timeout) throws Exceptio
});
new Thread(future).start();
future.get(timeout.toMillis(), TimeUnit.MILLISECONDS);
+ } else if (job.getClientMode() == SQLJobSubmission.ClientMode.REST) {
+ FutureTaskWithException<Void> future =
+ new FutureTaskWithException<>(
+ () -> {
+ Map<String, String> configMap =
+ GlobalConfiguration.loadConfiguration(
+
conf.toAbsolutePath().toString())
+ .toMap();
+ String host =
+ configMap.getOrDefault(
+
"sql-gateway.endpoint.rest.address",
+
InetAddress.getByName("localhost")
+ .getHostAddress());
+ String port =
+ configMap.getOrDefault(
+
"sql-gateway.endpoint.rest.port", "8083");
+ // Open a session
+ String sessionHandle = openSession(host, port);
Review Comment:
Done.
--
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]