diff --git a/fe/fe-core/src/main/java/org/apache/doris/datasource/CatalogProperty.java b/fe/fe-core/src/main/java/org/apache/doris/datasource/CatalogProperty.java index a734766d1fc7336..15967a80a1f9ce6 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/datasource/CatalogProperty.java +++ b/fe/fe-core/src/main/java/org/apache/doris/datasource/CatalogProperty.java @@ -131,6 +131,6 @@ public static CatalogProperty read(DataInput in) throws IOException { public void initialize(Type type) { metastoreProperties = new MetastoreProperties(type, properties); - storageProperties = new StorageProperties(properties); + // storageProperties = new StorageProperties(properties); } } diff --git a/fe/fe-core/src/main/java/org/apache/doris/datasource/property/storage/StorageProperties.java b/fe/fe-core/src/main/java/org/apache/doris/datasource/property/storage/StorageProperties.java index 1063c00956cd168..154fccade7a1e3a 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/datasource/property/storage/StorageProperties.java +++ b/fe/fe-core/src/main/java/org/apache/doris/datasource/property/storage/StorageProperties.java @@ -53,7 +53,7 @@ public StorageProperties create(Map origProps) throws UserExcept // In previous version, we don't support fs.xxx.support properties. // So we need to "guess" this info from the properties. - + throw new RuntimeException("Unknown storage type"); } protected StorageProperties(Type type, Map origProps) { diff --git a/fe/fe-core/src/test/java/org/apache/doris/datasource/CatalogAPITest.java b/fe/fe-core/src/test/java/org/apache/doris/datasource/CatalogAPITest.java index 5544ca72139cc10..24efaedfbfe6a11 100644 --- a/fe/fe-core/src/test/java/org/apache/doris/datasource/CatalogAPITest.java +++ b/fe/fe-core/src/test/java/org/apache/doris/datasource/CatalogAPITest.java @@ -1,7 +1,10 @@ package org.apache.doris.datasource; +import org.apache.doris.backup.Status; import org.apache.doris.common.security.authentication.AuthenticationConfig; import org.apache.doris.common.security.authentication.HadoopAuthenticator; +import org.apache.doris.fs.remote.RemoteFile; +import org.apache.doris.fs.remote.dfs.DFSFileSystem; import com.aliyun.datalake.metastore.hive2.ProxyMetaStoreClient; import com.amazonaws.glue.catalog.metastore.AWSCatalogMetastoreClient; @@ -19,9 +22,11 @@ import org.apache.paimon.catalog.CatalogContext; import org.apache.paimon.catalog.CatalogFactory; import org.apache.paimon.options.Options; +import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import java.io.IOException; +import java.util.ArrayList; import java.util.List; import java.util.Map; @@ -171,4 +176,26 @@ public void testPaimonHMSCatalog() throws IOException { return paimonCatalog; }); } + + @Test + public void testOSSHDFS() { + String remotePath = "oss://benchmark-dls.cn-beijing.oss-dls.aliyuncs.com/user/yy/tbl_oss_hdfs/"; + Map properties = Maps.newHashMap(); + properties.put("fs.oss.impl", "com.aliyun.jindodata.oss.JindoOssFileSystem"); + properties.put("fs.AbstractFileSystem.oss.impl", "com.aliyun.jindodata.oss.JindoOSS"); + properties.put("fs.oss.accessKeyId", ak); + properties.put("fs.oss.accessKeySecret", sk); + properties.put("fs.oss.endpoint", "cn-beijing.oss-dls.aliyuncs.com"); + DFSFileSystem fs = new DFSFileSystem(properties); + List results = new ArrayList<>(); + + Status st = fs.listFiles(remotePath, false, results); + if (!st.ok()) { + System.out.println("listFiles failed: " + st); + Assertions.fail(); + } + for (RemoteFile file : results) { + System.out.println(file); + } + } } \ No newline at end of file