From a9bd6f9063b2ba09124491d730383bef36a5e748 Mon Sep 17 00:00:00 2001 From: Daniel Henneberger Date: Tue, 1 Oct 2024 16:12:12 -0700 Subject: [PATCH] Use last instance of /data/ and /metadata/ path Signed-off-by: Daniel Henneberger --- src/common/utils.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/common/utils.cpp b/src/common/utils.cpp index 72af998..837a901 100644 --- a/src/common/utils.cpp +++ b/src/common/utils.cpp @@ -22,12 +22,12 @@ string IcebergUtils::GzFileToString(const string &path, FileSystem &fs) { } string IcebergUtils::GetFullPath(const string &iceberg_path, const string &relative_file_path, FileSystem &fs) { - std::size_t found = relative_file_path.find("/metadata/"); + std::size_t found = relative_file_path.rfind("/metadata/"); if (found != string::npos) { return fs.JoinPath(iceberg_path, relative_file_path.substr(found + 1)); } - found = relative_file_path.find("/data/"); + found = relative_file_path.rfind("/data/"); if (found != string::npos) { return fs.JoinPath(iceberg_path, relative_file_path.substr(found + 1)); }