From eb722afa5397ea7123ca33ffd0c887bdf5e4f937 Mon Sep 17 00:00:00 2001 From: gnehil Date: Fri, 9 Aug 2024 14:17:49 +0800 Subject: [PATCH] api path change --- .../src/main/java/org/apache/doris/client/DorisClient.java | 7 ++++--- .../src/main/java/org/apache/doris/common/Constants.java | 2 ++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/spark-load/spark-load-core/src/main/java/org/apache/doris/client/DorisClient.java b/spark-load/spark-load-core/src/main/java/org/apache/doris/client/DorisClient.java index b25d5ee7..1b93be2a 100644 --- a/spark-load/spark-load-core/src/main/java/org/apache/doris/client/DorisClient.java +++ b/spark-load/spark-load-core/src/main/java/org/apache/doris/client/DorisClient.java @@ -17,6 +17,7 @@ package org.apache.doris.client; +import org.apache.doris.common.Constants; import org.apache.doris.common.LoadInfo; import org.apache.doris.common.ResponseEntity; import org.apache.doris.common.meta.LoadInfoResponse; @@ -67,7 +68,7 @@ public static class FeClient { public static final String BASE_URL = "http://%s%s"; - public static final String INGESTION_LOAD_URL_PATTERN = "/api/ingestion_load/%s/%s"; + public static final String INGESTION_LOAD_URL_PATTERN = "/api/ingestion_load/%s/%s/%s"; public static final String CREATE_ACTION = "_create"; @@ -99,7 +100,7 @@ private String parseAuth(String user, String password) { public LoadMeta createIngestionLoad(String db, Map> tableToPartition, String label, Map properties) throws SparkLoadException { try { - String path = String.format(INGESTION_LOAD_URL_PATTERN, db, CREATE_ACTION); + String path = String.format(INGESTION_LOAD_URL_PATTERN, Constants.DEFAULT_CATALOG, db, CREATE_ACTION); HttpPost httpPost = new HttpPost(); addCommonHeaders(httpPost); Map params = new HashMap<>(); @@ -156,7 +157,7 @@ private String executeRequest(HttpRequestBase req, String apiPath, Map statusInfo) throws SparkLoadException { - String path = String.format(INGESTION_LOAD_URL_PATTERN, db, UPDATE_ACTION); + String path = String.format(INGESTION_LOAD_URL_PATTERN, Constants.DEFAULT_CATALOG, db, UPDATE_ACTION); HttpPost httpPost = new HttpPost(); addCommonHeaders(httpPost); Map params = new HashMap<>(); diff --git a/spark-load/spark-load-core/src/main/java/org/apache/doris/common/Constants.java b/spark-load/spark-load-core/src/main/java/org/apache/doris/common/Constants.java index 20130549..a3e4803e 100644 --- a/spark-load/spark-load-core/src/main/java/org/apache/doris/common/Constants.java +++ b/spark-load/spark-load-core/src/main/java/org/apache/doris/common/Constants.java @@ -26,4 +26,6 @@ public interface Constants { String HADOOP_KERBEROS_PRINCIPAL = "hadoop.kerberos.principal"; String HADOOP_KERBEROS_KEYTAB = "hadoop.kerberos.keytab"; + String DEFAULT_CATALOG = "internal"; + }