Skip to content

Commit 0871da3

Browse files
SteNicholasclaude
andcommitted
fix(blob): address review comments on include hygiene and test isolation
Include jdo_error.h directly in jindo_utils.h instead of relying on the transitive include from JdoStatus.hpp, and give each writer in BlobWriterBuilderTest.TestWriteNullOptions its own output file so that a Finish() in one scenario cannot leak bytes into the next. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent 13156e5 commit 0871da3

2 files changed

Lines changed: 9 additions & 1 deletion

File tree

src/paimon/format/blob/blob_writer_builder_test.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,18 @@ TEST_F(BlobWriterBuilderTest, TestWriteNullOptions) {
6565
PAIMON_RETURN_NOT_OK_FROM_ARROW(arrow::ExportArray(*array, c_array));
6666
return Status::OK();
6767
};
68+
// Each writer gets its own output file so that a Finish() in one scenario cannot leak
69+
// bytes into the next.
70+
int32_t file_index = 0;
6871
auto build_writer = [&](const std::map<std::string, std::string>& options)
6972
-> Result<std::unique_ptr<FormatWriter>> {
73+
PAIMON_ASSIGN_OR_RAISE(
74+
std::shared_ptr<OutputStream> out,
75+
file_system_->Create(dir_->Str() + "/file" + std::to_string(file_index++) + ".blob",
76+
/*overwrite=*/true));
7077
BlobWriterBuilder builder(struct_type_, options);
7178
builder.WithFileSystem(file_system_);
72-
return builder.Build(output_stream_, "none");
79+
return builder.Build(out, "none");
7380
};
7481

7582
ASSERT_OK_AND_ASSIGN(std::shared_ptr<Blob> missing_blob,

src/paimon/fs/jindo/jindo_utils.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
#pragma once
1818

1919
#include "JdoStatus.hpp" // NOLINT(build/include_subdir)
20+
#include "jdo_error.h" // NOLINT(build/include_subdir)
2021
#include "paimon/status.h"
2122

2223
namespace paimon::jindo {

0 commit comments

Comments
 (0)