Skip to content

Commit 122d1ae

Browse files
branch-3.0: [fix](regression)Fix unstable delta rows case. #43928 (#43987)
Cherry-picked from #43928 Co-authored-by: James <lijibing@selectdb.com>
1 parent 59e7ece commit 122d1ae

File tree

1 file changed

+28
-8
lines changed

1 file changed

+28
-8
lines changed

regression-test/suites/nereids_p0/delta_row/delta_row.groovy

+28-8
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,34 @@ suite("delta_row") {
4242
sql "set global enable_auto_analyze=false;"
4343

4444
sql "insert into t values (10, 'c');"
45-
explain {
46-
sql "physical plan select * from t where k > 6"
47-
contains("stats=0.5,")
48-
contains("stats=5(1)")
49-
notContains("stats=0,")
50-
notContains("stats=4 ")
45+
def result = sql """explain physical plan select * from t where k > 6"""
46+
logger.info("result:" + result)
47+
def stringResult = ""
48+
for (int i = 0; i < result.size(); i++) {
49+
stringResult += result[i]
50+
}
51+
logger.info("stringResult:" + stringResult)
52+
if (stringResult.contains("stats=5(1)")) {
53+
logger.info("rows not reported, test analyze rows + delta rows")
54+
assertTrue(stringResult.contains("stats=0.5,"))
55+
assertFalse(stringResult.contains("stats=0,"))
56+
assertFalse(stringResult.contains("stats=4 "))
57+
} else {
58+
logger.info("rows reported, test use reported rows.")
59+
result = sql """show index stats t t"""
60+
logger.info("index stats: " + result)
61+
assertEquals(1, result.size())
62+
assertNotEquals("-1", result[0][4])
63+
}
64+
// explain {
65+
// sql "physical plan select * from t where k > 6"
66+
// contains("stats=0.5,")
67+
// contains("stats=5(1)")
68+
// notContains("stats=0,")
69+
// notContains("stats=4 ")
70+
// cost = 5.00002
5171
// PhysicalResultSink[75] ( outputExprs=[k#0, v#1] )
5272
// +--PhysicalFilter[72]@1 ( stats=0.5, predicates=(k#0 > 6) )
5373
// +--PhysicalOlapScan[t]@0 ( stats=5(1) )
54-
}
55-
}
74+
}
75+

0 commit comments

Comments
 (0)