Skip to content

Commit c355ae6

Browse files
committed
filepath fix
1 parent 6447e54 commit c355ae6

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

src/Storages/ObjectStorage/ObjectStorageFilePathGenerator.h

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,23 @@ namespace DB
4747
using ObjectStorageFilePathGenerator::getPathForWrite; // Bring base class overloads into scope
4848
std::string getPathForWrite(const std::string & partition_id, const std::string & file_name_override) const override
4949
{
50+
std::string result;
51+
52+
result += raw_path;
53+
54+
if (raw_path.back() != '/')
55+
{
56+
result += "/";
57+
}
58+
59+
/// Not adding '/' because buildExpressionHive() always adds a trailing '/'
60+
result += partition_id;
61+
5062
const auto file_name = file_name_override.empty() ? std::to_string(generateSnowflakeID()) : file_name_override;
51-
return raw_path + "/" + partition_id + "/" + file_name + "." + file_format;
63+
64+
result += file_name + "." + file_format;
65+
66+
return result;
5267
}
5368

5469
std::string getPathForRead() const override

0 commit comments

Comments
 (0)