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

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


The following commit(s) were added to refs/heads/branch-3.1 by this push:
     new 5fbf4b13aee branch-3.1: [fix](oss)Support Aliyun OSS S3-Compatible 
Public Endpoint Format s3.oss-cn-xxx.aliyuncs.com #51894 (#53368)
5fbf4b13aee is described below

commit 5fbf4b13aeeaf1273ef0b436fd478c4be0988aad
Author: Calvin Kirs <[email protected]>
AuthorDate: Wed Jul 16 20:25:25 2025 +0800

    branch-3.1: [fix](oss)Support Aliyun OSS S3-Compatible Public Endpoint 
Format s3.oss-cn-xxx.aliyuncs.com #51894 (#53368)
    
    picked from #51894
---
 .../apache/doris/datasource/property/storage/OSSProperties.java   | 7 ++++++-
 .../doris/datasource/property/storage/OSSPropertiesTest.java      | 8 ++++++++
 2 files changed, 14 insertions(+), 1 deletion(-)

diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/datasource/property/storage/OSSProperties.java
 
b/fe/fe-core/src/main/java/org/apache/doris/datasource/property/storage/OSSProperties.java
index b33644cbbf0..52115433a6e 100644
--- 
a/fe/fe-core/src/main/java/org/apache/doris/datasource/property/storage/OSSProperties.java
+++ 
b/fe/fe-core/src/main/java/org/apache/doris/datasource/property/storage/OSSProperties.java
@@ -64,9 +64,14 @@ public class OSSProperties extends 
AbstractS3CompatibleProperties {
      * - <a href="http://oss-cn-shenzhen-internal.aliyuncs.com";>...</a> => 
region = cn-shenzhen
      * <p>
      * Group(1) captures the region name (e.g., cn-hangzhou).
+     *<p>
+     * Support S3 compatible endpoints:<a 
href="https://help.aliyun.com/zh/oss/developer-reference/
+     * use-amazon-s3-sdks-to-access-oss">...</a>
+     * - s3.cn-hangzhou.aliyuncs.com              => region = cn-hangzhou
+     * <p>
      */
     private static final Pattern ENDPOINT_PATTERN = Pattern
-            
.compile("^(?:https?://)?oss-([a-z0-9-]+?)(?:-internal)?\\.aliyuncs\\.com$");
+            
.compile("^(?:https?://)?(?:s3\\.)?oss-([a-z0-9-]+?)(?:-internal)?\\.aliyuncs\\.com$");
 
     protected OSSProperties(Map<String, String> origProps) {
         super(Type.OSS, origProps);
diff --git 
a/fe/fe-core/src/test/java/org/apache/doris/datasource/property/storage/OSSPropertiesTest.java
 
b/fe/fe-core/src/test/java/org/apache/doris/datasource/property/storage/OSSPropertiesTest.java
index 222c0f39f14..68611f48a0e 100644
--- 
a/fe/fe-core/src/test/java/org/apache/doris/datasource/property/storage/OSSPropertiesTest.java
+++ 
b/fe/fe-core/src/test/java/org/apache/doris/datasource/property/storage/OSSPropertiesTest.java
@@ -107,6 +107,14 @@ public class OSSPropertiesTest {
         Assertions.assertEquals("oss-cn-hangzhou.aliyuncs.com", 
ossProperties.getEndpoint());
         origProps.put("oss.endpoint", "oss-cn-hangzhou-internal.aliyuncs.com");
         Assertions.assertEquals("cn-hangzhou", ((OSSProperties) 
StorageProperties.createPrimary(origProps)).getRegion());
+        origProps.put("oss.endpoint", "s3.oss-cn-shanghai.aliyuncs.com");
+        Assertions.assertEquals("cn-shanghai", ((OSSProperties) 
StorageProperties.createPrimary(origProps)).getRegion());
+        origProps.put("oss.endpoint", 
"s3.oss-cn-hongkong-internal.aliyuncs.com");
+        Assertions.assertEquals("cn-hongkong", ((OSSProperties) 
StorageProperties.createPrimary(origProps)).getRegion());
+        origProps.put("oss.endpoint", 
"https://s3.oss-cn-hongkong-internal.aliyuncs.com";);
+        Assertions.assertEquals("cn-hongkong", ((OSSProperties) 
StorageProperties.createPrimary(origProps)).getRegion());
+        origProps.put("oss.endpoint", 
"http://s3.oss-cn-hongkong.aliyuncs.com";);
+        Assertions.assertEquals("cn-hongkong", ((OSSProperties) 
StorageProperties.createPrimary(origProps)).getRegion());
     }
 
     @Test


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to