Skip to content

Commit 6eceb35

Browse files
committed
Allow data and metadata by different paths
1 parent a5892c1 commit 6eceb35

File tree

1 file changed

+8
-1
lines changed
  • src/Storages/ObjectStorage/DataLakes/Iceberg

1 file changed

+8
-1
lines changed

src/Storages/ObjectStorage/DataLakes/Iceberg/Utils.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,14 @@ std::string getProperFilePathFromMetadataInfo(std::string_view data_path, std::s
8484
}
8585
else
8686
{
87-
throw ::DB::Exception(DB::ErrorCodes::BAD_ARGUMENTS, "Expected to find '{}' in data path: '{}'", common_path, data_path);
87+
/// Data files can have different path
88+
pos = data_path.find("://");
89+
if (pos == std::string::npos)
90+
throw ::DB::Exception(DB::ErrorCodes::BAD_ARGUMENTS, "Unexpected data path: '{}'", data_path);
91+
pos = data_path.find("/", pos + 3);
92+
if (pos == std::string::npos)
93+
throw ::DB::Exception(DB::ErrorCodes::BAD_ARGUMENTS, "Unexpected data path: '{}'", data_path);
94+
return std::string(data_path.substr(pos));
8895
}
8996
}
9097

0 commit comments

Comments
 (0)