From d7da19d5fcd93076523231f3df0b05de77a67cbd Mon Sep 17 00:00:00 2001 From: Guangming Lu <71873108+LuGuangming@users.noreply.github.com> Date: Fri, 10 Apr 2026 20:40:45 +0800 Subject: [PATCH] [improvement](cloud)The path_prefix can be flexibly specified when create a HDFS Storage Vault --- .../org/apache/doris/fs/remote/dfs/DFSFileSystem.java | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/fe/fe-core/src/main/java/org/apache/doris/fs/remote/dfs/DFSFileSystem.java b/fe/fe-core/src/main/java/org/apache/doris/fs/remote/dfs/DFSFileSystem.java index 2ee3c15693130a..a1a85effc8ea9e 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/fs/remote/dfs/DFSFileSystem.java +++ b/fe/fe-core/src/main/java/org/apache/doris/fs/remote/dfs/DFSFileSystem.java @@ -347,10 +347,8 @@ private static int readBytesFully(FSDataInputStream is, byte[] dest) throws IOEx @Override public Status exists(String remotePath) { try { - URI pathUri = URI.create(remotePath); - Path inputFilePath = new Path(pathUri.getLocation()); FileSystem fileSystem = nativeFileSystem(inputFilePath); - boolean isPathExist = hdfsProperties.getHadoopAuthenticator().doAs(() -> fileSystem.exists(inputFilePath)); + boolean isPathExist = hdfsProperties.getHadoopAuthenticator().doAs(() -> fileSystem.exists(new Path(remotePath))); if (!isPathExist) { return new Status(Status.ErrCode.NOT_FOUND, "remote path does not exist: " + remotePath); } @@ -484,10 +482,8 @@ public Status rename(String srcPath, String destPath) { @Override public Status delete(String remotePath) { try { - URI pathUri = URI.create(remotePath); - Path inputFilePath = new Path(pathUri.getLocation()); FileSystem fileSystem = nativeFileSystem(inputFilePath); - hdfsProperties.getHadoopAuthenticator().doAs(() -> fileSystem.delete(inputFilePath, true)); + hdfsProperties.getHadoopAuthenticator().doAs(() -> fileSystem.delete(new Path(remotePath), true)); } catch (UserException e) { return new Status(Status.ErrCode.COMMON_ERROR, e.getMessage()); } catch (IOException e) { @@ -510,8 +506,7 @@ public Status delete(String remotePath) { @Override public Status globList(String remotePath, List result, boolean fileNameOnly) { try { - URI pathUri = URI.create(remotePath); - Path pathPattern = new Path(S3Util.extendGlobs(pathUri.getLocation())); + Path pathPattern = new Path(S3Util.extendGlobs(remotePath)); FileSystem fileSystem = nativeFileSystem(pathPattern); FileStatus[] files = hdfsProperties.getHadoopAuthenticator().doAs(() -> fileSystem.globStatus(pathPattern)); if (files == null) {