From 9ba07f34179eae32453851c872c1cb7510ee1fa4 Mon Sep 17 00:00:00 2001 From: wuwenchi Date: Fri, 31 May 2024 14:08:32 +0800 Subject: [PATCH] fix --- .../writer/iceberg/viceberg_table_writer.cpp | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/be/src/vec/sink/writer/iceberg/viceberg_table_writer.cpp b/be/src/vec/sink/writer/iceberg/viceberg_table_writer.cpp index 12115c869aab40..2703330406cbe2 100644 --- a/be/src/vec/sink/writer/iceberg/viceberg_table_writer.cpp +++ b/be/src/vec/sink/writer/iceberg/viceberg_table_writer.cpp @@ -349,10 +349,19 @@ std::shared_ptr VIcebergTableWriter::_create_partition_ } const std::string& output_path = iceberg_table_sink.output_path; - auto write_path = fmt::format("{}/{}", output_path, partition_path); - auto original_write_path = - fmt::format("{}/{}", iceberg_table_sink.original_output_path, partition_path); - auto target_path = fmt::format("{}/{}", output_path, partition_path); + std::string write_path; + std::string original_write_path; + std::string target_path; + if (partition_path.empty()) { + original_write_path = iceberg_table_sink.original_output_path; + target_path = output_path; + write_path = output_path; + } else { + original_write_path = + fmt::format("{}/{}", iceberg_table_sink.original_output_path, partition_path); + target_path = fmt::format("{}/{}", output_path, partition_path); + write_path = fmt::format("{}/{}", output_path, partition_path); + } VIcebergPartitionWriter::WriteInfo write_info = { std::move(write_path), std::move(original_write_path), std::move(target_path),