[opt](fs)add local file support for 2.1 (#45632) (#45702)

bp: #45632
This commit is contained in:
wuwenchi
2024-12-23 10:25:34 +08:00
committed by GitHub
parent 818fd88a10
commit b845813e6f
2 changed files with 4 additions and 0 deletions

View File

@ -38,6 +38,7 @@ import com.aliyun.datalake.metastore.common.DataLakeConfig;
import com.amazonaws.glue.catalog.util.AWSGlueConfig;
import com.google.common.base.Strings;
import com.google.common.collect.Maps;
import org.apache.hadoop.fs.LocalFileSystem;
import org.apache.hadoop.fs.aliyun.oss.AliyunOSSFileSystem;
import org.apache.hadoop.fs.s3a.Constants;
import org.apache.hadoop.fs.s3a.S3AFileSystem;
@ -182,6 +183,8 @@ public class PropertyConverter {
public static String getHadoopFSImplByScheme(String fsScheme) {
if (fsScheme.equalsIgnoreCase("obs")) {
return ObsProperties.HadoopFsObsConstants.HADOOP_FS_OBS_CLASS_NAME;
} 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")) {

View File

@ -55,6 +55,7 @@ public class FileSystemFactory {
switch (type) {
case S3:
return new S3FileSystem(properties);
case FILE:
case DFS:
return new DFSFileSystem(properties);
case OFS: