ulysses-you commented on code in PR #4221:
URL: https://github.com/apache/kyuubi/pull/4221#discussion_r1094138877
##########
kyuubi-rest-client/src/main/java/org/apache/kyuubi/client/BatchRestApi.java:
##########
@@ -43,6 +49,16 @@ public Batch createBatch(BatchRequest request) {
return this.getClient().post(API_BASE_PATH, requestBody, Batch.class,
client.getAuthHeader());
}
+ public Batch createBatch(BatchRequest request, File resourceFile) {
+ MultipartEntityBuilder entityBuilder =
+ MultipartEntityBuilder.create().setCharset(StandardCharsets.UTF_8);
+ entityBuilder.addPart(
+ "batchRequest", new StringBody(JsonUtils.toJson(request),
ContentType.APPLICATION_JSON));
+ entityBuilder.addPart("resourceFile", new FileBody(resourceFile));
+ return this.getClient()
+ .post(API_BASE_PATH, entityBuilder.build(), Batch.class,
client.getAuthHeader());
Review Comment:
the whole usage of entityBuilder is `resourceFile` right ? I mean there is
no other code except name or file...
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]