From cf23aa5af506662b166f9d600bd13706cac8e8b4 Mon Sep 17 00:00:00 2001 From: wuwenchi Date: Fri, 20 Dec 2024 09:43:16 +0800 Subject: [PATCH] [opt](fs)add local file support (#45632) ### What problem does this PR solve? Problem Summary: Added support for local files to facilitate debugging of some local files in the data lake. --- .../apache/doris/datasource/property/PropertyConverter.java | 3 +++ .../src/main/java/org/apache/doris/fs/FileSystemFactory.java | 1 + 2 files changed, 4 insertions(+) diff --git a/fe/fe-core/src/main/java/org/apache/doris/datasource/property/PropertyConverter.java b/fe/fe-core/src/main/java/org/apache/doris/datasource/property/PropertyConverter.java index 8544ae597f1cd3..7b65411aa6b484 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/datasource/property/PropertyConverter.java +++ b/fe/fe-core/src/main/java/org/apache/doris/datasource/property/PropertyConverter.java @@ -41,6 +41,7 @@ import com.google.common.collect.Maps; import org.apache.hadoop.fs.CosFileSystem; import org.apache.hadoop.fs.CosNConfigKeys; +import org.apache.hadoop.fs.LocalFileSystem; import org.apache.hadoop.fs.aliyun.oss.AliyunOSSFileSystem; import org.apache.hadoop.fs.obs.OBSConstants; import org.apache.hadoop.fs.obs.OBSFileSystem; @@ -193,6 +194,8 @@ private static Map convertToOBSProperties(Map pr public static String getHadoopFSImplByScheme(String fsScheme) { if (fsScheme.equalsIgnoreCase("obs")) { return OBSFileSystem.class.getName(); + } else if (fsScheme.equalsIgnoreCase("file")) { + return LocalFileSystem.class.getName(); } else if (fsScheme.equalsIgnoreCase("oss")) { return AliyunOSSFileSystem.class.getName(); } else if (fsScheme.equalsIgnoreCase("cosn") || fsScheme.equalsIgnoreCase("lakefs")) { diff --git a/fe/fe-core/src/main/java/org/apache/doris/fs/FileSystemFactory.java b/fe/fe-core/src/main/java/org/apache/doris/fs/FileSystemFactory.java index 1f3d60d2adf2eb..fb23005f4ac9ac 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/fs/FileSystemFactory.java +++ b/fe/fe-core/src/main/java/org/apache/doris/fs/FileSystemFactory.java @@ -63,6 +63,7 @@ public static RemoteFileSystem getRemoteFileSystem(FileSystemType type, Map