From ccbd65daebda1a1a4465b71b85f0b1a76dc789ee Mon Sep 17 00:00:00 2001 From: "Yunfeng,Wu" Date: Tue, 26 Nov 2019 22:52:10 +0800 Subject: [PATCH] Ensure ES endpoint without http prefix can work (#2303) --- .../main/java/org/apache/doris/external/EsRestClient.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/fe/src/main/java/org/apache/doris/external/EsRestClient.java b/fe/src/main/java/org/apache/doris/external/EsRestClient.java index 88cd61c0db..7f9b7bc0ad 100644 --- a/fe/src/main/java/org/apache/doris/external/EsRestClient.java +++ b/fe/src/main/java/org/apache/doris/external/EsRestClient.java @@ -107,6 +107,13 @@ public class EsRestClient { if (!Strings.isEmpty(basicAuth)) { builder.addHeader("Authorization", basicAuth); } + + // maybe should add HTTP schema to the address + // actually, at this time we can only process http protocol + if (!(currentNode.startsWith("http://") || currentNode.startsWith("https://"))) { + currentNode = "http://" + currentNode; + } + Request request = builder.get() .url(currentNode + "/" + path) .build();