diff --git a/be/src/vec/sink/writer/vhive_partition_writer.cpp b/be/src/vec/sink/writer/vhive_partition_writer.cpp index f88a695b3b..4504faf0e9 100644 --- a/be/src/vec/sink/writer/vhive_partition_writer.cpp +++ b/be/src/vec/sink/writer/vhive_partition_writer.cpp @@ -136,6 +136,9 @@ Status VHivePartitionWriter::open(RuntimeState* state, RuntimeProfile* profile) } Status VHivePartitionWriter::close(const Status& status) { + if (status.ok()) { + _state->hive_partition_updates().emplace_back(_build_partition_update()); + } if (_file_format_transformer != nullptr) { Status st = _file_format_transformer->close(); if (!st.ok()) { @@ -150,7 +153,6 @@ Status VHivePartitionWriter::close(const Status& status) { LOG(WARNING) << fmt::format("Delete file {} failed, reason: {}", path, st.to_string()); } } - _state->hive_partition_updates().emplace_back(_build_partition_update()); return Status::OK(); } @@ -201,11 +203,14 @@ THivePartitionUpdate VHivePartitionWriter::_build_partition_update() { hive_partition_update.__set_location(location); hive_partition_update.__set_file_names({_get_target_file_name()}); hive_partition_update.__set_row_count(_row_count); + DCHECK(_file_format_transformer != nullptr); hive_partition_update.__set_file_size(_file_format_transformer->written_len()); if (_write_info.file_type == TFileType::FILE_S3) { + DCHECK(_file_writer != nullptr); doris::io::S3FileWriter* s3_mpu_file_writer = dynamic_cast(_file_writer.get()); + DCHECK(s3_mpu_file_writer != nullptr); TS3MPUPendingUpload s3_mpu_pending_upload; s3_mpu_pending_upload.__set_bucket(s3_mpu_file_writer->bucket()); s3_mpu_pending_upload.__set_key(s3_mpu_file_writer->key()); diff --git a/be/src/vec/sink/writer/vhive_table_writer.cpp b/be/src/vec/sink/writer/vhive_table_writer.cpp index 7c3a864ebb..76f16e3daa 100644 --- a/be/src/vec/sink/writer/vhive_table_writer.cpp +++ b/be/src/vec/sink/writer/vhive_table_writer.cpp @@ -208,7 +208,8 @@ Status VHiveTableWriter::close(Status status) { for (const auto& pair : _partitions_to_writers) { Status st = pair.second->close(status); if (st != Status::OK()) { - LOG(WARNING) << fmt::format("Unsupported type for partition {}", st.to_string()); + LOG(WARNING) << fmt::format("partition writer close failed for partition {}", + st.to_string()); continue; } } @@ -330,15 +331,15 @@ std::vector VHiveTableWriter::_create_partition_values(vectorized:: partition_column, position); // Check if value contains only printable ASCII characters - bool isValid = true; + bool is_valid = true; for (char c : value) { if (c < 0x20 || c > 0x7E) { - isValid = false; + is_valid = false; break; } } - if (!isValid) { + if (!is_valid) { // Encode value using Base16 encoding with space separator std::stringstream encoded; for (unsigned char c : value) { @@ -414,7 +415,6 @@ std::string VHiveTableWriter::_to_partition_value(const TypeDescriptor& type_des char buf[64]; char* pos = value.to_string(buf); return std::string(buf, pos - buf - 1); - break; } case TYPE_DATEV2: { DateV2Value value =