Skip to content

Commit 1d9a654

Browse files
committed
[fix](regression) Avoid Paimon physical row order assumption
### What problem does this PR solve? Issue Number: close apache#66816 Related PR: apache#67207 Problem Summary: The cross-file Paimon metadata regression assumed that physical row positions follow INSERT value order. Paimon may arrange rows differently inside each data file, so the test observed the valid positions 1 and 2 in reverse id order. Group results by file path and verify that each of the two files exposes two rows at absolute positions 1 and 2 without coupling the assertion to file-internal ordering. ### Release note None ### Check List (For Author) - Test: Regression test - External Regression build 1037121 reproduced the over-constrained assertion; git diff --check passed - Full Paimon Docker regression will be rerun in community CI - Behavior changed: No - Does this need documentation: No
1 parent 9e83bc7 commit 1d9a654

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

‎regression-test/suites/external_table_p0/paimon/test_paimon_file_metadata_columns.groovy‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -130,14 +130,14 @@ suite("test_paimon_file_metadata_columns", "p0,external") {
130130
order by id
131131
"""
132132
assertEquals(4, crossFileRows.size())
133-
assertEquals([1L, 2L, 1L, 2L], crossFileRows.collect { it[2].toString().toLong() })
134-
def firstFile = crossFileRows[0][1].toString()
135-
def secondFile = crossFileRows[2][1].toString()
136-
assertTrue(firstFile.contains("/data/") && secondFile.contains("/data/"),
137-
"metadata columns must expose raw Paimon data-file paths")
138-
assertEquals(firstFile, crossFileRows[1][1].toString())
139-
assertEquals(secondFile, crossFileRows[3][1].toString())
140-
assertTrue(firstFile != secondFile, "two append commits must retain distinct source-file paths")
133+
def rowsByFile = crossFileRows.groupBy { it[1].toString() }
134+
assertEquals(2, rowsByFile.size())
135+
rowsByFile.each { filePath, rows ->
136+
assertTrue(filePath.contains("/data/"),
137+
"metadata columns must expose raw Paimon data-file paths")
138+
assertEquals(2, rows.size())
139+
assertEquals([1L, 2L], rows.collect { it[2].toString().toLong() }.sort())
140+
}
141141

142142
sql """switch ${catalogName}"""
143143
sql """use db1"""

0 commit comments

Comments
 (0)