Skip to content

Commit 91ced1f

Browse files
[AURON #2451] Add Paimon COW multi-commit correctness coverage (#2452)
**Which issue does this PR close?** Closes #2451 **Rationale for this change** The existing Paimon COW test verifies only a single commit. It does not protect against stale rows being returned after a later commit updates an existing primary key. This change adds multi-commit correctness coverage while keeping the native scan implementation unchanged. **What changes are included in this PR?** Updates the existing Paimon COW primary-key integration test to: - Write the initial rows. - Write a newer value for an existing primary key in a second commit. - Verify that only the latest value is returned. - Verify that the query still uses `NativePaimonV2TableScan`. **Are there any user-facing changes?** No user-facing changes. **How was this patch tested?** UT. --------- Signed-off-by: weimingdiit <weimingdiit@gmail.com> Co-authored-by: Shilun Fan <slfan1989@apache.org>
1 parent 53200b0 commit 91ced1f

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

thirdparty/auron-paimon/src/test/scala/org/apache/auron/paimon/AuronPaimonV2IntegrationSuite.scala

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,26 @@ class AuronPaimonV2IntegrationSuite
143143
}
144144
}
145145

146+
test("paimon v2 native scan preserves latest COW value after compaction") {
147+
withTable("paimon.db.t_cow_multi_commit") {
148+
sql("""
149+
|create table paimon.db.t_cow_multi_commit (id int, v string)
150+
|using paimon
151+
|tblproperties (
152+
| 'primary-key' = 'id',
153+
| 'bucket' = '2',
154+
| 'full-compaction.delta-commits' = '1'
155+
|)
156+
|""".stripMargin)
157+
sql("insert into paimon.db.t_cow_multi_commit values (1, 'a'), (2, 'b')")
158+
sql("insert into paimon.db.t_cow_multi_commit values (1, 'updated')")
159+
sql("CALL paimon.sys.compact(table => 'db.t_cow_multi_commit')")
160+
val df = sql("select * from paimon.db.t_cow_multi_commit")
161+
checkAnswer(df, Seq(Row(1, "updated"), Row(2, "b")))
162+
assertNativePaimonScanApplied(df)
163+
}
164+
}
165+
146166
test("paimon v2 native scan handles empty table") {
147167
withTable("paimon.db.t_empty") {
148168
sql("create table paimon.db.t_empty (id int, v string) using paimon")

0 commit comments

Comments
 (0)