Skip to content

Commit 3048ac4

Browse files
authored
fix: remove trailing semicolons from statement-like macro definitions (alibaba#351)
1 parent 666c2c7 commit 3048ac4

12 files changed

Lines changed: 22 additions & 21 deletions

File tree

include/paimon/result.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -270,11 +270,11 @@ inline Status GenericToStatus(Result<T>&& res) {
270270
#define PAIMON_ASSIGN_OR_RAISE_IMPL(result_name, lhs, rexpr) \
271271
auto&& result_name = (rexpr); \
272272
PAIMON_RETURN_IF_(!(result_name).ok(), (result_name).status(), PAIMON_STRINGIFY(rexpr)); \
273-
lhs = std::move(result_name).value();
273+
lhs = std::move(result_name).value()
274274

275275
#define PAIMON_ASSIGN_OR_RAISE_NAME(x, y) PAIMON_CONCAT(x, y)
276276

277277
#define PAIMON_ASSIGN_OR_RAISE(lhs, rexpr) \
278278
PAIMON_ASSIGN_OR_RAISE_IMPL(PAIMON_ASSIGN_OR_RAISE_NAME(_error_or_value, __COUNTER__), lhs, \
279-
(rexpr));
279+
(rexpr))
280280
} // namespace paimon

src/paimon/common/file_index/bitmap/bitmap_index_result.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ Result<std::shared_ptr<FileIndexResult>> BitmapIndexResult::And(
4848
typed_other]() -> Result<RoaringBitmap32> {
4949
PAIMON_ASSIGN_OR_RAISE(const RoaringBitmap32* bitmap, result->GetBitmap());
5050
PAIMON_ASSIGN_OR_RAISE(const RoaringBitmap32* other_bitmap,
51-
typed_other->GetBitmap())
51+
typed_other->GetBitmap());
5252
return RoaringBitmap32::And(*bitmap, *other_bitmap);
5353
});
5454
}
@@ -64,7 +64,7 @@ Result<std::shared_ptr<FileIndexResult>> BitmapIndexResult::Or(
6464
typed_other]() -> Result<RoaringBitmap32> {
6565
PAIMON_ASSIGN_OR_RAISE(const RoaringBitmap32* bitmap, result->GetBitmap());
6666
PAIMON_ASSIGN_OR_RAISE(const RoaringBitmap32* other_bitmap,
67-
typed_other->GetBitmap())
67+
typed_other->GetBitmap());
6868
return RoaringBitmap32::Or(*bitmap, *other_bitmap);
6969
});
7070
}

src/paimon/common/utils/arrow/status_utils.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,10 +96,10 @@ inline Status ToPaimonStatus(const arrow::Status& status) {
9696
auto&& result_name = (rexpr); \
9797
PAIMON_RETURN_IF_(!(result_name).ok(), ToPaimonStatus((result_name).status()), \
9898
PAIMON_STRINGIFY(rexpr)); \
99-
lhs = std::move(result_name).ValueUnsafe();
99+
lhs = std::move(result_name).ValueUnsafe()
100100

101101
#define PAIMON_ASSIGN_OR_RAISE_FROM_ARROW(lhs, rexpr) \
102102
PAIMON_ASSIGN_OR_RAISE_IMPL_FROM_ARROW( \
103-
PAIMON_ASSIGN_OR_RAISE_NAME(_error_or_value, __COUNTER__), lhs, (rexpr));
103+
PAIMON_ASSIGN_OR_RAISE_NAME(_error_or_value, __COUNTER__), lhs, (rexpr))
104104

105105
} // namespace paimon

src/paimon/core/casting/cast_executor_test.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2522,7 +2522,7 @@ TEST_F(CastExecutorTest, TestBooleanToDecimalCastExecutorCastLiteral) {
25222522
}
25232523
{
25242524
ASSERT_OK_AND_ASSIGN(Literal valid_literal,
2525-
cast_executor->Cast(Literal(false), arrow::decimal128(3, 3)))
2525+
cast_executor->Cast(Literal(false), arrow::decimal128(3, 3)));
25262526
ASSERT_EQ(valid_literal, Literal(Decimal(3, 3, 0)));
25272527
}
25282528
}

src/paimon/core/manifest/manifest_entry_serializer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ Result<ManifestEntry> ManifestEntrySerializer::ConvertFrom(int32_t version,
5353
return Status::Invalid("ManifestEntry convert from row failed, with null DataFileMeta");
5454
}
5555
PAIMON_ASSIGN_OR_RAISE(std::shared_ptr<DataFileMeta> meta,
56-
data_file_meta_serializer_.FromRow(*file))
56+
data_file_meta_serializer_.FromRow(*file));
5757
return ManifestEntry(file_kind, partition, bucket, total_buckets, meta);
5858
}
5959

src/paimon/core/mergetree/compact/merge_tree_compact_rewriter_test.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ TEST_F(MergeTreeCompactRewriterTest, TestSimple) {
117117

118118
// generate sorted runs and rewrite
119119
ASSERT_OK_AND_ASSIGN(auto runs, GenerateSortedRuns(table_path, table_schema, /*bucket=*/1,
120-
/*partition=*/{{"f1", "10"}}))
120+
/*partition=*/{{"f1", "10"}}));
121121
ASSERT_OK_AND_ASSIGN(auto compact_result, rewriter->Rewrite(
122122
/*output_level=*/5, /*drop_delete=*/true, runs));
123123
// check compact result
@@ -214,7 +214,7 @@ TEST_F(MergeTreeCompactRewriterTest, TestNotDropDelete) {
214214

215215
// generate sorted runs and rewrite
216216
ASSERT_OK_AND_ASSIGN(auto runs, GenerateSortedRuns(table_path, table_schema, /*bucket=*/1,
217-
/*partition=*/{{"f1", "10"}}))
217+
/*partition=*/{{"f1", "10"}}));
218218
ASSERT_OK_AND_ASSIGN(auto compact_result, rewriter->Rewrite(
219219
/*output_level=*/5, /*drop_delete=*/false, runs));
220220
// check compact result
@@ -285,7 +285,7 @@ TEST_F(MergeTreeCompactRewriterTest, TestIOException) {
285285

286286
// generate sorted runs and rewrite
287287
ASSERT_OK_AND_ASSIGN(auto runs, GenerateSortedRuns(table_path, table_schema, /*bucket=*/1,
288-
/*partition=*/{{"f1", "10"}}))
288+
/*partition=*/{{"f1", "10"}}));
289289
// rewrite may trigger I/O exception
290290
ScopeGuard guard([&io_hook]() { io_hook->Clear(); });
291291
io_hook->Reset(i, IOHook::Mode::RETURN_ERROR);

src/paimon/core/operation/abstract_file_store_write.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ Status AbstractFileStoreWrite::Write(std::unique_ptr<RecordBatch>&& batch) {
126126
PAIMON_RETURN_NOT_OK_FROM_ARROW(arrow::ExportArray(*data, batch->GetData()));
127127

128128
PAIMON_ASSIGN_OR_RAISE(BinaryRow partition,
129-
file_store_path_factory_->ToBinaryRow(batch->GetPartition()))
129+
file_store_path_factory_->ToBinaryRow(batch->GetPartition()));
130130
PAIMON_ASSIGN_OR_RAISE(std::shared_ptr<BatchWriter> writer,
131131
GetWriter(partition, batch->GetBucket()));
132132
assert(writer);

src/paimon/core/operation/file_store_commit_impl_test.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -253,8 +253,9 @@ class FileStoreCommitImplTest : public testing::Test {
253253

254254
EXPECT_OK_AND_ASSIGN(std::unique_ptr<InputStream> in_stream, file_system->Open(path));
255255
EXPECT_TRUE(in_stream);
256-
EXPECT_OK_AND_ASSIGN([[maybe_unused]] int32_t length,
257-
in_stream->Read(reinterpret_cast<char*>(buffer.data()), buffer.size()))
256+
EXPECT_OK_AND_ASSIGN(
257+
[[maybe_unused]] int32_t length,
258+
in_stream->Read(reinterpret_cast<char*>(buffer.data()), buffer.size()));
258259
EXPECT_OK(in_stream->Close());
259260
auto pool = GetDefaultPool();
260261

src/paimon/format/orc/orc_file_batch_reader_test.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ class OrcFileBatchReaderTest : public ::testing::Test,
154154
const std::optional<RoaringBitmap32>& selection_bitmap, int32_t batch_size) const {
155155
EXPECT_OK_AND_ASSIGN(
156156
auto orc_batch_reader,
157-
OrcFileBatchReader::Create(std::move(in_stream), pool_, options, batch_size))
157+
OrcFileBatchReader::Create(std::move(in_stream), pool_, options, batch_size));
158158
EXPECT_TRUE(orc_batch_reader);
159159
std::unique_ptr<ArrowSchema> c_schema = std::make_unique<ArrowSchema>();
160160
auto arrow_status = arrow::ExportSchema(*read_schema, c_schema.get());

src/paimon/global_index/lumina/lumina_global_index.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ Result<std::vector<GlobalIndexIOMeta>> LuminaIndexWriter::Finish() {
321321
PAIMON_ASSIGN_OR_RAISE(std::string index_file_name,
322322
file_manager_->NewFileName(LuminaDefines::kIdentifier));
323323
PAIMON_ASSIGN_OR_RAISE(std::shared_ptr<OutputStream> out,
324-
file_manager_->NewOutputStream(index_file_name))
324+
file_manager_->NewOutputStream(index_file_name));
325325
auto file_writer = std::make_unique<LuminaFileWriter>(out);
326326
PAIMON_RETURN_NOT_OK_FROM_LUMINA(builder.Dump(std::move(file_writer), io_options_));
327327
// prepare GlobalIndexIOMeta

0 commit comments

Comments
 (0)