Coverage Report

Created: 2026-03-13 09:34

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
be/src/io/fs/local_file_system.cpp
Line
Count
Source
1
// Licensed to the Apache Software Foundation (ASF) under one
2
// or more contributor license agreements.  See the NOTICE file
3
// distributed with this work for additional information
4
// regarding copyright ownership.  The ASF licenses this file
5
// to you under the Apache License, Version 2.0 (the
6
// "License"); you may not use this file except in compliance
7
// with the License.  You may obtain a copy of the License at
8
//
9
//   http://www.apache.org/licenses/LICENSE-2.0
10
//
11
// Unless required by applicable law or agreed to in writing,
12
// software distributed under the License is distributed on an
13
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14
// KIND, either express or implied.  See the License for the
15
// specific language governing permissions and limitations
16
// under the License.
17
18
#include "io/fs/local_file_system.h"
19
20
#include <fcntl.h>
21
#include <fmt/format.h>
22
#include <glob.h>
23
#include <glog/logging.h>
24
#include <openssl/md5.h>
25
#include <sys/mman.h>
26
#include <sys/stat.h>
27
#include <unistd.h>
28
29
#include <filesystem>
30
#include <iomanip>
31
#include <istream>
32
#include <system_error>
33
#include <utility>
34
35
#include "common/exception.h"
36
#include "cpp/sync_point.h"
37
#include "io/fs/err_utils.h"
38
#include "io/fs/file_system.h"
39
#include "io/fs/file_writer.h"
40
#include "io/fs/local_file_reader.h"
41
#include "io/fs/local_file_writer.h"
42
#include "runtime/thread_context.h"
43
#include "storage/data_dir.h"
44
#include "util/async_io.h" // IWYU pragma: keep
45
#include "util/debug_points.h"
46
#include "util/defer_op.h"
47
48
namespace doris::io {
49
50
std::filesystem::perms LocalFileSystem::PERMS_OWNER_RW =
51
        std::filesystem::perms::owner_read | std::filesystem::perms::owner_write;
52
53
8
LocalFileSystem::LocalFileSystem() : FileSystem(FileSystem::TMP_FS_ID, FileSystemType::LOCAL) {}
54
55
3
LocalFileSystem::~LocalFileSystem() = default;
56
57
Status LocalFileSystem::create_file_impl(const Path& file, FileWriterPtr* writer,
58
137k
                                         const FileWriterOptions* opts) {
59
18.4E
    VLOG_DEBUG << "create file: " << file.native()
60
18.4E
               << ", sync_data: " << (opts ? opts->sync_file_data : true);
61
137k
    TEST_SYNC_POINT_RETURN_WITH_VALUE("LocalFileSystem::create_file_impl",
62
137k
                                      Status::IOError("inject io error"));
63
    // O_TRUNC: if file already exists (last tmp), clear the content
64
137k
    int fd = ::open(file.c_str(), O_TRUNC | O_WRONLY | O_CREAT | O_CLOEXEC, 0666);
65
137k
    DBUG_EXECUTE_IF("LocalFileSystem.create_file_impl.open_file_failed", {
66
        // spare '.testfile' to make bad disk checker happy
67
137k
        auto sub_path = dp->param<std::string>("sub_path", "");
68
137k
        if ((sub_path.empty() && file.filename().compare(kTestFilePath)) ||
69
137k
            (!sub_path.empty() && file.native().find(sub_path) != std::string::npos)) {
70
137k
            ::close(fd);
71
137k
            fd = -1;
72
137k
            errno = EIO;
73
137k
            LOG(WARNING) << Status::IOError("debug open io error: {}", file.native());
74
137k
        }
75
137k
    });
76
137k
    if (-1 == fd) {
77
1
        return localfs_error(errno, fmt::format("failed to create file {}", file.native()));
78
1
    }
79
137k
    bool sync_data = opts != nullptr ? opts->sync_file_data : true;
80
137k
    *writer = std::make_unique<LocalFileWriter>(file, fd, sync_data);
81
137k
    return Status::OK();
82
137k
}
83
84
Status LocalFileSystem::open_file_impl(const Path& file, FileReaderSPtr* reader,
85
609k
                                       const FileReaderOptions* opts) {
86
609k
    TEST_SYNC_POINT_RETURN_WITH_VALUE("LocalFileSystem::open_file_impl",
87
609k
                                      Status::IOError("inject io error"));
88
609k
    int64_t fsize = opts ? opts->file_size : -1;
89
609k
    if (fsize < 0) {
90
607k
        RETURN_IF_ERROR(file_size_impl(file, &fsize));
91
607k
    }
92
600k
    int fd = -1;
93
600k
    RETRY_ON_EINTR(fd, open(file.c_str(), O_RDONLY));
94
600k
    DBUG_EXECUTE_IF("LocalFileSystem.create_file_impl.open_file_failed", {
95
        // spare '.testfile' to make bad disk checker happy
96
600k
        auto sub_path = dp->param<std::string>("sub_path", "");
97
600k
        if ((sub_path.empty() && file.filename().compare(kTestFilePath)) ||
98
600k
            (!sub_path.empty() && file.native().find(sub_path) != std::string::npos)) {
99
600k
            ::close(fd);
100
600k
            fd = -1;
101
600k
            errno = EIO;
102
600k
            LOG(WARNING) << Status::IOError("debug open io error: {}", file.native());
103
600k
        }
104
600k
    });
105
600k
    if (fd < 0) {
106
0
        return localfs_error(errno, fmt::format("failed to open {}", file.native()));
107
0
    }
108
600k
    *reader = std::make_shared<LocalFileReader>(file, fsize, fd);
109
600k
    return Status::OK();
110
600k
}
111
112
235k
Status LocalFileSystem::create_directory_impl(const Path& dir, bool failed_if_exists) {
113
18.4E
    VLOG_DEBUG << "create directory: " << dir.native()
114
18.4E
               << ", failed_if_exists: " << failed_if_exists;
115
235k
    bool exists = true;
116
235k
    RETURN_IF_ERROR(exists_impl(dir, &exists));
117
235k
    if (exists && failed_if_exists) {
118
0
        return Status::AlreadyExist("failed to create {}, already exists", dir.native());
119
0
    }
120
235k
    if (!exists) {
121
220k
        std::error_code ec;
122
220k
        std::filesystem::create_directories(dir, ec);
123
220k
        if (ec) {
124
0
            return localfs_error(ec, fmt::format("failed to create {}", dir.native()));
125
0
        }
126
220k
    }
127
235k
    return Status::OK();
128
235k
}
129
130
242k
Status LocalFileSystem::delete_file_impl(const Path& file) {
131
242k
    VLOG_DEBUG << "delete file: " << file.native();
132
242k
    bool exists = true;
133
242k
    RETURN_IF_ERROR(exists_impl(file, &exists));
134
242k
    if (!exists) {
135
117k
        return Status::OK();
136
117k
    }
137
125k
    if (!std::filesystem::is_regular_file(file)) {
138
1
        return Status::InternalError("failed to delete {}, not a file", file.native());
139
1
    }
140
125k
    std::error_code ec;
141
125k
    std::filesystem::remove(file, ec);
142
125k
    if (ec) {
143
0
        return localfs_error(ec, fmt::format("failed to delete {}", file.native()));
144
0
    }
145
125k
    return Status::OK();
146
125k
}
147
148
180k
Status LocalFileSystem::delete_directory_impl(const Path& dir) {
149
180k
    VLOG_DEBUG << "delete directory: " << dir.native();
150
180k
    bool exists = true;
151
180k
    RETURN_IF_ERROR(exists_impl(dir, &exists));
152
180k
    if (!exists) {
153
902
        return Status::OK();
154
902
    }
155
179k
    if (!std::filesystem::is_directory(dir)) {
156
1
        return Status::InternalError("failed to delete {}, not a directory", dir.native());
157
1
    }
158
179k
    std::error_code ec;
159
179k
    std::filesystem::remove_all(dir, ec);
160
179k
    if (ec) {
161
2
        return localfs_error(ec, fmt::format("failed to delete {}", dir.native()));
162
2
    }
163
179k
    return Status::OK();
164
179k
}
165
166
24
Status LocalFileSystem::delete_directory_or_file(const Path& path) {
167
24
    FILESYSTEM_M(delete_directory_or_file_impl(path));
168
0
}
169
170
24
Status LocalFileSystem::delete_directory_or_file_impl(const Path& path) {
171
24
    bool is_dir;
172
24
    RETURN_IF_ERROR(is_directory(path, &is_dir));
173
22
    if (is_dir) {
174
1
        return delete_directory_impl(path);
175
21
    } else {
176
21
        return delete_file_impl(path);
177
21
    }
178
22
}
179
180
0
Status LocalFileSystem::batch_delete_impl(const std::vector<Path>& files) {
181
0
    for (auto& file : files) {
182
0
        RETURN_IF_ERROR(delete_file_impl(file));
183
0
    }
184
0
    return Status::OK();
185
0
}
186
187
2.57M
Status LocalFileSystem::exists_impl(const Path& path, bool* res) const {
188
2.57M
    std::error_code ec;
189
2.57M
    *res = std::filesystem::exists(path, ec);
190
2.57M
    if (ec) {
191
0
        return localfs_error(ec, fmt::format("failed to check exists {}", path.native()));
192
0
    }
193
2.57M
    return Status::OK();
194
2.57M
}
195
196
627k
Status LocalFileSystem::file_size_impl(const Path& file, int64_t* file_size) const {
197
627k
    std::error_code ec;
198
627k
    *file_size = std::filesystem::file_size(file, ec);
199
627k
    if (ec) {
200
9.45k
        return localfs_error(ec, fmt::format("failed to get file size {}", file.native()));
201
9.45k
    }
202
617k
    return Status::OK();
203
627k
}
204
205
185k
Status LocalFileSystem::directory_size(const Path& dir_path, size_t* dir_size) {
206
185k
    *dir_size = 0;
207
185k
    if (std::filesystem::exists(dir_path) && std::filesystem::is_directory(dir_path)) {
208
1.31M
        for (const auto& entry : std::filesystem::recursive_directory_iterator(dir_path)) {
209
1.31M
            if (std::filesystem::is_regular_file(entry)) {
210
7.46k
                *dir_size += std::filesystem::file_size(entry);
211
7.46k
            }
212
1.31M
        }
213
185k
        return Status::OK();
214
185k
    }
215
    // TODO(plat1ko): Use error code according to std::error_code
216
0
    return Status::InternalError("faile to get dir size {}", dir_path.native());
217
185k
}
218
219
Status LocalFileSystem::list_impl(const Path& dir, bool only_file, std::vector<FileInfo>* files,
220
849k
                                  bool* exists) {
221
849k
    RETURN_IF_ERROR(exists_impl(dir, exists));
222
849k
    if (!exists) {
223
0
        return Status::OK();
224
0
    }
225
849k
    std::error_code ec;
226
849k
    try {
227
37.8M
        for (const auto& entry : std::filesystem::directory_iterator(dir, ec)) {
228
37.8M
            if (only_file && !entry.is_regular_file()) {
229
104
                continue;
230
104
            }
231
37.8M
            FileInfo file_info;
232
37.8M
            file_info.file_name = entry.path().filename();
233
37.8M
            file_info.is_file = entry.is_regular_file(ec);
234
37.8M
            if (ec) {
235
0
                break;
236
0
            }
237
37.8M
            if (file_info.is_file) {
238
132k
                file_info.file_size = entry.file_size(ec);
239
132k
                if (ec) {
240
2
                    break;
241
2
                }
242
132k
            }
243
37.8M
            files->push_back(std::move(file_info));
244
37.8M
        }
245
849k
    } catch (const std::filesystem::filesystem_error& e) {
246
        // although `directory_iterator(dir, ec)` does not throw an exception,
247
        // it may throw an exception during iterator++, so we need to catch the exception here
248
1
        return localfs_error(e.code(), fmt::format("failed to list {}, error message: {}",
249
1
                                                   dir.native(), e.what()));
250
1
    }
251
849k
    if (ec) {
252
2.12k
        return localfs_error(ec, fmt::format("failed to list {}", dir.native()));
253
2.12k
    }
254
847k
    return Status::OK();
255
849k
}
256
257
117k
Status LocalFileSystem::rename_impl(const Path& orig_name, const Path& new_name) {
258
18.4E
    VLOG_DEBUG << "rename file: " << orig_name.native() << " to " << new_name.native();
259
117k
    TEST_SYNC_POINT_RETURN_WITH_VALUE("LocalFileSystem::rename",
260
117k
                                      Status::IOError("inject io error"));
261
117k
    std::error_code ec;
262
117k
    std::filesystem::rename(orig_name, new_name, ec);
263
117k
    if (ec) {
264
1
        return localfs_error(ec, fmt::format("failed to rename {} to {}", orig_name.native(),
265
1
                                             new_name.native()));
266
1
    }
267
117k
    return Status::OK();
268
117k
}
269
270
205
Status LocalFileSystem::link_file(const Path& src, const Path& dest) {
271
205
    FILESYSTEM_M(link_file_impl(src, dest));
272
0
}
273
274
205
Status LocalFileSystem::link_file_impl(const Path& src, const Path& dest) {
275
205
    VLOG_DEBUG << "link file: " << src.native() << " to " << dest.native();
276
205
    if (::link(src.c_str(), dest.c_str()) != 0) {
277
0
        return localfs_error(errno, fmt::format("failed to create hard link from {} to {}",
278
0
                                                src.native(), dest.native()));
279
0
    }
280
205
    return Status::OK();
281
205
}
282
283
1.35k
Status LocalFileSystem::canonicalize(const Path& path, std::string* real_path) {
284
1.35k
    std::error_code ec;
285
1.35k
    Path res = std::filesystem::canonical(path, ec);
286
1.35k
    if (ec) {
287
0
        return localfs_error(ec, fmt::format("failed to canonicalize {}", path.native()));
288
0
    }
289
1.35k
    *real_path = res.string();
290
1.35k
    return Status::OK();
291
1.35k
}
292
293
368
Status LocalFileSystem::is_directory(const Path& path, bool* res) {
294
368
    std::error_code ec;
295
368
    *res = std::filesystem::is_directory(path, ec);
296
368
    if (ec) {
297
4
        return localfs_error(ec, fmt::format("failed to canonicalize {}", path.native()));
298
4
    }
299
364
    return Status::OK();
300
368
}
301
302
448
Status LocalFileSystem::md5sum(const Path& file, std::string* md5sum) {
303
448
    FILESYSTEM_M(md5sum_impl(file, md5sum));
304
0
}
305
306
448
Status LocalFileSystem::md5sum_impl(const Path& file, std::string* md5sum) {
307
448
    int fd = open(file.c_str(), O_RDONLY);
308
448
    if (fd < 0) {
309
0
        return localfs_error(errno,
310
0
                             fmt::format("failed to open file for md5sum {}", file.native()));
311
0
    }
312
313
448
    struct stat statbuf;
314
448
    if (fstat(fd, &statbuf) < 0) {
315
0
        std::string err = errno_to_str();
316
0
        close(fd);
317
0
        return localfs_error(errno, fmt::format("failed to stat file {}", file.native()));
318
0
    }
319
448
    size_t file_len = statbuf.st_size;
320
448
    void* buf = mmap(nullptr, file_len, PROT_READ, MAP_SHARED, fd, 0);
321
322
448
    unsigned char result[MD5_DIGEST_LENGTH];
323
448
    MD5((unsigned char*)buf, file_len, result);
324
448
    munmap(buf, file_len);
325
326
448
    std::stringstream ss;
327
7.61k
    for (int32_t i = 0; i < MD5_DIGEST_LENGTH; i++) {
328
7.16k
        ss << std::setfill('0') << std::setw(2) << std::hex << (int)result[i];
329
7.16k
    }
330
448
    ss >> *md5sum;
331
332
448
    close(fd);
333
448
    return Status::OK();
334
448
}
335
336
Status LocalFileSystem::iterate_directory(const std::string& dir,
337
908
                                          const std::function<bool(const FileInfo& file)>& cb) {
338
908
    FILESYSTEM_M(iterate_directory_impl(dir, cb));
339
0
}
340
341
Status LocalFileSystem::iterate_directory_impl(
342
908
        const std::string& dir, const std::function<bool(const FileInfo& file)>& cb) {
343
908
    bool exists = true;
344
908
    std::vector<FileInfo> files;
345
908
    RETURN_IF_ERROR(list_impl(dir, false, &files, &exists));
346
908
    for (auto& file : files) {
347
65
        if (!cb(file)) {
348
2
            break;
349
2
        }
350
65
    }
351
908
    return Status::OK();
352
908
}
353
354
203k
Status LocalFileSystem::get_space_info(const Path& dir, size_t* capacity, size_t* available) {
355
203k
    FILESYSTEM_M(get_space_info_impl(dir, capacity, available));
356
0
}
357
358
203k
Status LocalFileSystem::get_space_info_impl(const Path& path, size_t* capacity, size_t* available) {
359
203k
    std::error_code ec;
360
203k
    std::filesystem::space_info info = std::filesystem::space(path, ec);
361
203k
    if (ec) {
362
8.10k
        return localfs_error(
363
8.10k
                ec, fmt::format("failed to get available space for path {}", path.native()));
364
8.10k
    }
365
195k
    *capacity = info.capacity;
366
195k
    *available = info.available;
367
195k
    return Status::OK();
368
203k
}
369
370
2
Status LocalFileSystem::copy_path(const Path& src, const Path& dest) {
371
2
    FILESYSTEM_M(copy_path_impl(src, dest));
372
0
}
373
374
2
Status LocalFileSystem::copy_path_impl(const Path& src, const Path& dest) {
375
2
    VLOG_DEBUG << "copy from " << src.native() << " to " << dest.native();
376
2
    std::error_code ec;
377
2
    std::filesystem::copy(src, dest, std::filesystem::copy_options::recursive, ec);
378
2
    if (ec) {
379
0
        return localfs_error(
380
0
                ec, fmt::format("failed to copy from {} to {}", src.native(), dest.native()));
381
0
    }
382
2
    return Status::OK();
383
2
}
384
385
296
bool LocalFileSystem::contain_path(const Path& parent_, const Path& sub_) {
386
296
    Path parent = parent_.lexically_normal();
387
296
    Path sub = sub_.lexically_normal();
388
296
    if (parent == sub) {
389
0
        return true;
390
0
    }
391
392
296
    if (parent.filename() == ".") {
393
0
        parent.remove_filename();
394
0
    }
395
396
    // We're also not interested in the file's name.
397
296
    if (sub.has_filename()) {
398
296
        sub.remove_filename();
399
296
    }
400
    // If dir has more components than file, then file can't possibly reside in dir.
401
296
    auto dir_len = std::distance(parent.begin(), parent.end());
402
296
    auto file_len = std::distance(sub.begin(), sub.end());
403
296
    if (dir_len > file_len) {
404
0
        return false;
405
0
    }
406
296
    auto p_it = parent.begin();
407
296
    auto s_it = sub.begin();
408
312
    for (; p_it != parent.end() && !p_it->string().empty(); ++p_it, ++s_it) {
409
16
        if (!(*p_it == *s_it)) {
410
0
            return false;
411
0
        }
412
16
    }
413
296
    return true;
414
296
}
415
416
156
bool LocalFileSystem::equal_or_sub_path(const Path& parent, const Path& child) {
417
156
    auto parent_path = parent.lexically_normal();
418
156
    auto child_path = child.lexically_normal();
419
156
    auto parent_it = parent_path.begin();
420
156
    auto child_it = child_path.begin();
421
1.21k
    for (; parent_it != parent_path.end() && child_it != child_path.end();
422
1.06k
         ++parent_it, ++child_it) {
423
1.06k
        if (*parent_it != *child_it) {
424
1
            return false;
425
1
        }
426
1.06k
    }
427
155
    return parent_it == parent_path.end();
428
156
}
429
430
2.62M
const std::shared_ptr<LocalFileSystem>& global_local_filesystem() {
431
2.62M
    static std::shared_ptr<LocalFileSystem> local_fs(new LocalFileSystem());
432
2.62M
    return local_fs;
433
2.62M
}
434
435
Status LocalFileSystem::canonicalize_local_file(const std::string& dir,
436
                                                const std::string& file_path,
437
292
                                                std::string* full_path) {
438
292
    const std::string absolute_path = dir + "/" + file_path;
439
292
    std::string canonical_path;
440
292
    RETURN_IF_ERROR(canonicalize(absolute_path, &canonical_path));
441
292
    if (!contain_path(dir, canonical_path)) {
442
0
        return Status::InvalidArgument("file path is not allowed: {}", canonical_path);
443
0
    }
444
445
292
    *full_path = canonical_path;
446
292
    return Status::OK();
447
292
}
448
449
297
Status LocalFileSystem::safe_glob(const std::string& path, std::vector<FileInfo>* res) {
450
297
    if (path.find("..") != std::string::npos) {
451
5
        return Status::InvalidArgument("can not contain '..' in path");
452
5
    }
453
292
    std::string full_path = config::user_files_secure_path + "/" + path;
454
292
    std::vector<std::string> files;
455
292
    RETURN_IF_ERROR(_glob(full_path, &files));
456
292
    for (auto& file : files) {
457
292
        FileInfo fi;
458
292
        fi.is_file = true;
459
292
        RETURN_IF_ERROR(canonicalize_local_file("", file, &(fi.file_name)));
460
292
        RETURN_IF_ERROR(file_size_impl(fi.file_name, &(fi.file_size)));
461
292
        res->push_back(std::move(fi));
462
292
    }
463
280
    return Status::OK();
464
280
}
465
466
292
Status LocalFileSystem::_glob(const std::string& pattern, std::vector<std::string>* res) {
467
292
    glob_t glob_result;
468
292
    memset(&glob_result, 0, sizeof(glob_result));
469
470
292
    int rc = glob(pattern.c_str(), GLOB_TILDE, NULL, &glob_result);
471
292
    if (rc != 0) {
472
12
        globfree(&glob_result);
473
12
        return Status::InternalError("failed to glob {}: {}", pattern, glob_err_to_str(rc));
474
12
    }
475
476
572
    for (size_t i = 0; i < glob_result.gl_pathc; ++i) {
477
292
        res->push_back(std::string(glob_result.gl_pathv[i]));
478
292
    }
479
480
280
    globfree(&glob_result);
481
280
    return Status::OK();
482
292
}
483
484
36
Status LocalFileSystem::permission(const Path& file, std::filesystem::perms prms) {
485
36
    FILESYSTEM_M(permission_impl(file, prms));
486
0
}
487
488
36
Status LocalFileSystem::permission_impl(const Path& file, std::filesystem::perms prms) {
489
36
    std::error_code ec;
490
36
    std::filesystem::permissions(file, prms, ec);
491
36
    if (ec) {
492
0
        return localfs_error(ec, fmt::format("failed to change file permission {}", file.native()));
493
0
    }
494
36
    return Status::OK();
495
36
}
496
497
3.60M
Status LocalFileSystem::convert_to_abs_path(const Path& input_path_str, Path& abs_path) {
498
    // valid path include:
499
    //   1. abc/def                         will return abc/def
500
    //   2. /abc/def                        will return /abc/def
501
    //   3. file:/abc/def                   will return /abc/def
502
    //   4. file://<authority>/abc/def      will return /abc/def
503
3.60M
    std::string path_str = input_path_str;
504
3.60M
    size_t slash = path_str.find('/');
505
3.60M
    if (slash == 0) {
506
3.53M
        abs_path = input_path_str;
507
3.53M
        return Status::OK();
508
3.53M
    }
509
510
    // Initialize scheme and authority
511
67.9k
    std::string scheme;
512
67.9k
    size_t start = 0;
513
514
    // Parse URI scheme
515
67.9k
    size_t colon = path_str.find(':');
516
67.9k
    if (colon != std::string::npos && (slash == std::string::npos || colon < slash)) {
517
        // Has a scheme
518
10
        scheme = path_str.substr(0, colon);
519
10
        if (scheme != "file") {
520
3
            return Status::InternalError(
521
3
                    "Only supports `file` type scheme, like 'file:///path', 'file:/path'.");
522
3
        }
523
7
        start = colon + 1;
524
7
    }
525
526
    // Parse URI authority, if any
527
67.9k
    if (path_str.compare(start, 2, "//") == 0 && path_str.length() - start > 2) {
528
        // Has authority
529
        // such as : path_str = "file://authority/abc/def"
530
        // and now : start = 5
531
6
        size_t next_slash = path_str.find('/', start + 2);
532
        // now : next_slash = 16
533
6
        if (next_slash == std::string::npos) {
534
1
            return Status::InternalError(
535
1
                    "This input string only has authority, but has no path information");
536
1
        }
537
        // We will skit authority
538
        // now : start = 16
539
5
        start = next_slash;
540
5
    }
541
542
    // URI path is the rest of the string
543
67.9k
    abs_path = path_str.substr(start);
544
67.9k
    return Status::OK();
545
67.9k
}
546
547
} // namespace doris::io