This is an automated email from the ASF dual-hosted git repository.

yiguolei pushed a commit to branch branch-2.1
in repository https://gitbox.apache.org/repos/asf/doris.git

commit 1a6f8c443e329db2a4828c12fd815447369014b5
Author: wuwenchi <wuwenchi...@hotmail.com>
AuthorDate: Fri Apr 19 11:23:19 2024 +0800

    [bugfix](paimon) Create paimon catalog with hadoop user (#33833)
    
    When creating a catalog, paimon will create a warehouse on HDFS, so we need 
to use the corresponding user with permissions to create it.
---
 .../doris/datasource/paimon/PaimonExternalCatalog.java   | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/datasource/paimon/PaimonExternalCatalog.java
 
b/fe/fe-core/src/main/java/org/apache/doris/datasource/paimon/PaimonExternalCatalog.java
index 0a273e5424c..11691224681 100644
--- 
a/fe/fe-core/src/main/java/org/apache/doris/datasource/paimon/PaimonExternalCatalog.java
+++ 
b/fe/fe-core/src/main/java/org/apache/doris/datasource/paimon/PaimonExternalCatalog.java
@@ -120,13 +120,15 @@ public abstract class PaimonExternalCatalog extends 
ExternalCatalog {
     }
 
     protected Catalog createCatalog() {
-        Options options = new Options();
-        Map<String, String> paimonOptionsMap = getPaimonOptionsMap();
-        for (Map.Entry<String, String> kv : paimonOptionsMap.entrySet()) {
-            options.set(kv.getKey(), kv.getValue());
-        }
-        CatalogContext context = CatalogContext.create(options, 
getConfiguration());
-        return createCatalogImpl(context);
+        return HadoopUGI.ugiDoAs(authConf, () -> {
+            Options options = new Options();
+            Map<String, String> paimonOptionsMap = getPaimonOptionsMap();
+            for (Map.Entry<String, String> kv : paimonOptionsMap.entrySet()) {
+                options.set(kv.getKey(), kv.getValue());
+            }
+            CatalogContext context = CatalogContext.create(options, 
getConfiguration());
+            return createCatalogImpl(context);
+        });
     }
 
     protected Catalog createCatalogImpl(CatalogContext context) {


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to