Skip to content

Commit 1bc520d

Browse files
committed
fix
1 parent 8596334 commit 1bc520d

5 files changed

Lines changed: 16 additions & 23 deletions

File tree

src/paimon/core/operation/commit/commit_changes_provider.cpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,10 @@ class FixedInputCommitChangesProvider final : public CommitChangesProvider {
2727
FixedInputCommitChangesProvider(std::vector<ManifestEntry> delta_files,
2828
std::vector<ManifestEntry> changelog_files,
2929
std::vector<IndexManifestEntry> index_entries)
30-
: commit_changes_(std::make_shared<CommitChanges>(std::move(delta_files),
31-
std::move(changelog_files),
32-
std::move(index_entries))) {}
30+
: commit_changes_(std::make_shared<CommitChanges>(
31+
std::move(delta_files), std::move(changelog_files), std::move(index_entries))) {}
3332

34-
Result<std::shared_ptr<CommitChanges>> Provide(
35-
const std::optional<Snapshot>&) const override {
33+
Result<std::shared_ptr<CommitChanges>> Provide(const std::optional<Snapshot>&) const override {
3634
return commit_changes_;
3735
}
3836

src/paimon/core/operation/commit/commit_changes_provider.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,7 @@ class CommitChangesProvider {
4848
virtual ~CommitChangesProvider() = default;
4949

5050
static std::shared_ptr<CommitChangesProvider> Provider(
51-
std::vector<ManifestEntry> delta_files,
52-
std::vector<ManifestEntry> changelog_files,
51+
std::vector<ManifestEntry> delta_files, std::vector<ManifestEntry> changelog_files,
5352
std::vector<IndexManifestEntry> index_entries);
5453

5554
virtual Result<std::shared_ptr<CommitChanges>> Provide(

src/paimon/core/operation/commit/commit_scanner.cpp

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,7 @@ Result<std::vector<ManifestEntry>> CommitScanner::ReadAllEntriesFromPartitions(
109109
}
110110

111111
Result<std::unique_ptr<FileStoreScan>> CommitScanner::NewScan(
112-
const std::vector<std::map<std::string, std::string>>& partitions,
113-
bool for_overwrite) const {
112+
const std::vector<std::map<std::string, std::string>>& partitions, bool for_overwrite) const {
114113
auto scan_filter = std::make_shared<ScanFilter>(/*predicate=*/nullptr, partitions,
115114
/*bucket_filter=*/std::nullopt);
116115
if (!scan_supplier_) {
@@ -175,10 +174,9 @@ std::shared_ptr<CommitChangesProvider> CommitScanner::OverwriteChangesProvider(
175174
[this, partitions](const Snapshot& snapshot) -> Result<std::vector<ManifestEntry>> {
176175
PAIMON_ASSIGN_OR_RAISE(std::unique_ptr<FileStoreScan> scan,
177176
NewScan(partitions, /*for_overwrite=*/true));
178-
PAIMON_ASSIGN_OR_RAISE(std::shared_ptr<FileStoreScan::RawPlan> plan,
179-
scan->WithSnapshot(snapshot)
180-
->WithKind(ScanMode::ALL)
181-
->CreatePlan());
177+
PAIMON_ASSIGN_OR_RAISE(
178+
std::shared_ptr<FileStoreScan::RawPlan> plan,
179+
scan->WithSnapshot(snapshot)->WithKind(ScanMode::ALL)->CreatePlan());
182180
return plan->Files();
183181
},
184182
[this, partitions](const Snapshot& snapshot) {

src/paimon/core/operation/commit/overwrite_changes_provider.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@
2424

2525
namespace paimon {
2626

27-
OverwriteChangesProvider::OverwriteChangesProvider(
28-
std::vector<ManifestEntry> changes, std::vector<IndexManifestEntry> index_entries,
29-
ManifestScan manifest_scan, IndexScan index_scan)
27+
OverwriteChangesProvider::OverwriteChangesProvider(std::vector<ManifestEntry> changes,
28+
std::vector<IndexManifestEntry> index_entries,
29+
ManifestScan manifest_scan, IndexScan index_scan)
3030
: changes_(std::move(changes)),
3131
index_entries_(std::move(index_entries)),
3232
manifest_scan_(std::move(manifest_scan)),
@@ -51,7 +51,7 @@ Result<std::shared_ptr<CommitChanges>> OverwriteChangesProvider::Provide(
5151
for (const auto& entry : entries) {
5252
existing_identifiers.insert(entry.CreateIdentifier());
5353
delta_files.emplace_back(FileKind::Delete(), entry.Partition(), entry.Bucket(),
54-
entry.TotalBuckets(), entry.File());
54+
entry.TotalBuckets(), entry.File());
5555
}
5656

5757
for (const auto& change : changes_) {

src/paimon/core/operation/commit/overwrite_changes_provider_test.cpp

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -200,9 +200,8 @@ TEST(OverwriteChangesProviderTest, TestProvidePropagatesScanErrors) {
200200
return std::vector<IndexManifestEntry>{};
201201
});
202202

203-
ASSERT_NOK_WITH_MSG(
204-
provider_manifest_fail.Provide(std::optional<Snapshot>(MakeSnapshot())),
205-
"manifest scan failed");
203+
ASSERT_NOK_WITH_MSG(provider_manifest_fail.Provide(std::optional<Snapshot>(MakeSnapshot())),
204+
"manifest scan failed");
206205

207206
OverwriteChangesProvider provider_index_fail(
208207
changes, index_entries,
@@ -213,9 +212,8 @@ TEST(OverwriteChangesProviderTest, TestProvidePropagatesScanErrors) {
213212
return Status::Invalid("index scan failed");
214213
});
215214

216-
ASSERT_NOK_WITH_MSG(
217-
provider_index_fail.Provide(std::optional<Snapshot>(MakeSnapshot())),
218-
"index scan failed");
215+
ASSERT_NOK_WITH_MSG(provider_index_fail.Provide(std::optional<Snapshot>(MakeSnapshot())),
216+
"index scan failed");
219217
}
220218

221219
} // namespace paimon::test

0 commit comments

Comments
 (0)