diff --git a/fe/fe-core/src/main/java/org/apache/doris/datasource/hive/HiveMetaStoreClientHelper.java b/fe/fe-core/src/main/java/org/apache/doris/datasource/hive/HiveMetaStoreClientHelper.java index 952454e4a95e8a..2e7693619b847c 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/datasource/hive/HiveMetaStoreClientHelper.java +++ b/fe/fe-core/src/main/java/org/apache/doris/datasource/hive/HiveMetaStoreClientHelper.java @@ -66,6 +66,7 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; +import java.net.URI; import java.security.PrivilegedExceptionAction; import java.time.LocalDateTime; import java.time.ZoneId; @@ -826,6 +827,15 @@ public static T ugiDoAs(Configuration conf, PrivilegedExceptionAction act public static HoodieTableMetaClient getHudiClient(HMSExternalTable table) { String hudiBasePath = table.getRemoteTable().getSd().getLocation(); Configuration conf = getConfiguration(table); + if (LOG.isDebugEnabled()) { + LOG.debug("try setting 'fs.xxx.impl.disable.cache' to true for hudi's base path: {}", hudiBasePath); + } + URI hudiBasePathUri = URI.create(hudiBasePath); + String scheme = hudiBasePathUri.getScheme(); + if (!Strings.isNullOrEmpty(scheme)) { + // Avoid using Cache in Hadoop FileSystem, which may cause FE OOM. + conf.set("fs." + scheme + ".impl.disable.cache", "true"); + } return HadoopUGI.ugiDoAs(AuthenticationConfig.getKerberosConfig(conf), () -> HoodieTableMetaClient.builder().setConf(conf).setBasePath(hudiBasePath).build()); }