Skip to content

Commit 7e4f32a

Browse files
author
xiaohongbo
committed
[lance] do not relace oss scheme to s3 scheme in LanceUtils and keep origin oss config
1 parent 66b3ec2 commit 7e4f32a

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

paimon-lance/src/main/java/org/apache/paimon/format/lance/LanceUtils.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,6 @@ public static Pair<Path, Map<String, String>> toLanceSpecified(FileIO fileIO, Pa
9898
originOptions = new Options();
9999
}
100100

101-
Path converted = path;
102101
Map<String, String> storageOptions = new HashMap<>();
103102
if ("oss".equals(schema)) {
104103
assert originOptions.containsKey("fs.oss.endpoint");
@@ -127,9 +126,8 @@ public static Pair<Path, Map<String, String>> toLanceSpecified(FileIO fileIO, Pa
127126
if (originOptions.containsKey("fs.oss.endpoint")) {
128127
storageOptions.put("oss_endpoint", originOptions.get("fs.oss.endpoint"));
129128
}
130-
converted = new Path(uri.toString().replace("oss://", "s3://"));
131129
}
132130

133-
return Pair.of(converted, storageOptions);
131+
return Pair.of(path, storageOptions);
134132
}
135133
}

paimon-lance/src/test/java/org/apache/paimon/format/lance/LanceUtilsTest.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,8 @@ void testOssUrlConversion() {
7070

7171
Pair<Path, Map<String, String>> result = LanceUtils.toLanceSpecified(fileIO, path);
7272

73-
assertTrue(result.getKey().toString().startsWith("s3://test-bucket/"));
73+
// Keep oss:// scheme (same as Python implementation)
74+
assertTrue(result.getKey().toString().startsWith("oss://test-bucket/"));
7475

7576
Map<String, String> storageOptions = result.getValue();
7677
assertEquals(

0 commit comments

Comments
 (0)