You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@inlong.apache.org by "Yizhou-Yang (via GitHub)" <gi...@apache.org> on 2023/08/23 07:31:11 UTC

[GitHub] [inlong] Yizhou-Yang opened a new pull request, #8787: [INLONG-8786][Sort] fix doris schema change in case of multiple uri

Yizhou-Yang opened a new pull request, #8787:
URL: https://github.com/apache/inlong/pull/8787

   ### Prepare a Pull Request
   - Fixes #8786
   
   ### Motivation
   A user experience exception when combining doris ddl changes with a very long fenode list.
   
   ### Modifications
   parse the fenodes, try to execute http request on each one, return when any succeeds.
   
   ### Verifying this change
   Tested using a flink job.
   
   Trivial change.


-- 
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: commits-unsubscribe@inlong.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [inlong] Yizhou-Yang commented on a diff in pull request #8787: [INLONG-8786][Sort] Fix doris schema change in case of multiple uri

Posted by "Yizhou-Yang (via GitHub)" <gi...@apache.org>.
Yizhou-Yang commented on code in PR #8787:
URL: https://github.com/apache/inlong/pull/8787#discussion_r1303864478


##########
inlong-sort/sort-flink/sort-flink-v1.13/sort-connectors/doris/src/main/java/org/apache/inlong/sort/doris/schema/SchemaChangeHelper.java:
##########
@@ -415,12 +417,22 @@ private String authHeader() {
     private boolean executeStatement(String database, String stmt) throws IOException {
         Map<String, String> param = new HashMap<>();
         param.put("stmt", stmt);
-        String requestUrl = String.format(SCHEMA_CHANGE_API, options.getFenodes(), database);
-        HttpPost httpPost = new HttpPost(requestUrl);
-        httpPost.setHeader(HttpHeaders.AUTHORIZATION, authHeader());
-        httpPost.setHeader(HttpHeaders.CONTENT_TYPE, CONTENT_TYPE_JSON);
-        httpPost.setEntity(new StringEntity(dynamicSchemaFormat.objectMapper.writeValueAsString(param)));
-        return sendRequest(httpPost);
+        List<String> fenodes = Arrays.asList(options.getFenodes().split(","));

Review Comment:
   it will not, there is a precondition check during initialization:   this.fenodes = Preconditions.checkNotNull(fenodes, "fenodes  is empty");
   



-- 
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: commits-unsubscribe@inlong.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [inlong] healchow commented on a diff in pull request #8787: [INLONG-8786][Sort] Fix doris schema change in case of multiple uri

Posted by "healchow (via GitHub)" <gi...@apache.org>.
healchow commented on code in PR #8787:
URL: https://github.com/apache/inlong/pull/8787#discussion_r1306859390


##########
inlong-sort/sort-flink/sort-flink-v1.13/sort-connectors/doris/src/main/java/org/apache/inlong/sort/doris/schema/SchemaChangeHelper.java:
##########
@@ -415,12 +417,22 @@ private String authHeader() {
     private boolean executeStatement(String database, String stmt) throws IOException {
         Map<String, String> param = new HashMap<>();
         param.put("stmt", stmt);
-        String requestUrl = String.format(SCHEMA_CHANGE_API, options.getFenodes(), database);
-        HttpPost httpPost = new HttpPost(requestUrl);
-        httpPost.setHeader(HttpHeaders.AUTHORIZATION, authHeader());
-        httpPost.setHeader(HttpHeaders.CONTENT_TYPE, CONTENT_TYPE_JSON);
-        httpPost.setEntity(new StringEntity(dynamicSchemaFormat.objectMapper.writeValueAsString(param)));
-        return sendRequest(httpPost);
+        List<String> fenodes = Arrays.asList(options.getFenodes().split(","));

Review Comment:
   Okay~



-- 
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: commits-unsubscribe@inlong.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [inlong] healchow commented on a diff in pull request #8787: [INLONG-8786][Sort] Fix doris schema change in case of multiple uri

Posted by "healchow (via GitHub)" <gi...@apache.org>.
healchow commented on code in PR #8787:
URL: https://github.com/apache/inlong/pull/8787#discussion_r1302734749


##########
inlong-sort/sort-flink/sort-flink-v1.13/sort-connectors/doris/src/main/java/org/apache/inlong/sort/doris/schema/SchemaChangeHelper.java:
##########
@@ -415,12 +417,22 @@ private String authHeader() {
     private boolean executeStatement(String database, String stmt) throws IOException {
         Map<String, String> param = new HashMap<>();
         param.put("stmt", stmt);
-        String requestUrl = String.format(SCHEMA_CHANGE_API, options.getFenodes(), database);
-        HttpPost httpPost = new HttpPost(requestUrl);
-        httpPost.setHeader(HttpHeaders.AUTHORIZATION, authHeader());
-        httpPost.setHeader(HttpHeaders.CONTENT_TYPE, CONTENT_TYPE_JSON);
-        httpPost.setEntity(new StringEntity(dynamicSchemaFormat.objectMapper.writeValueAsString(param)));
-        return sendRequest(httpPost);
+        List<String> fenodes = Arrays.asList(options.getFenodes().split(","));

Review Comment:
   Will this `options.getFenodes()` be null?



-- 
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: commits-unsubscribe@inlong.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [inlong] dockerzhang merged pull request #8787: [INLONG-8786][Sort] Fix doris schema change in case of multiple uri

Posted by "dockerzhang (via GitHub)" <gi...@apache.org>.
dockerzhang merged PR #8787:
URL: https://github.com/apache/inlong/pull/8787


-- 
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: commits-unsubscribe@inlong.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org