Skip to content

Commit

Permalink
branch-3.0: [fix](regression)Fix unstable delta rows case. #43928 (#4…
Browse files Browse the repository at this point in the history
…3987)

Cherry-picked from #43928

Co-authored-by: James <[email protected]>
  • Loading branch information
github-actions[bot] and Jibing-Li authored Nov 15, 2024
1 parent 59e7ece commit 122d1ae
Showing 1 changed file with 28 additions and 8 deletions.
36 changes: 28 additions & 8 deletions regression-test/suites/nereids_p0/delta_row/delta_row.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,34 @@ suite("delta_row") {
sql "set global enable_auto_analyze=false;"

sql "insert into t values (10, 'c');"
explain {
sql "physical plan select * from t where k > 6"
contains("stats=0.5,")
contains("stats=5(1)")
notContains("stats=0,")
notContains("stats=4 ")
def result = sql """explain physical plan select * from t where k > 6"""
logger.info("result:" + result)
def stringResult = ""
for (int i = 0; i < result.size(); i++) {
stringResult += result[i]
}
logger.info("stringResult:" + stringResult)
if (stringResult.contains("stats=5(1)")) {
logger.info("rows not reported, test analyze rows + delta rows")
assertTrue(stringResult.contains("stats=0.5,"))
assertFalse(stringResult.contains("stats=0,"))
assertFalse(stringResult.contains("stats=4 "))
} else {
logger.info("rows reported, test use reported rows.")
result = sql """show index stats t t"""
logger.info("index stats: " + result)
assertEquals(1, result.size())
assertNotEquals("-1", result[0][4])
}
// explain {
// sql "physical plan select * from t where k > 6"
// contains("stats=0.5,")
// contains("stats=5(1)")
// notContains("stats=0,")
// notContains("stats=4 ")
// cost = 5.00002
// PhysicalResultSink[75] ( outputExprs=[k#0, v#1] )
// +--PhysicalFilter[72]@1 ( stats=0.5, predicates=(k#0 > 6) )
// +--PhysicalOlapScan[t]@0 ( stats=5(1) )
}
}
}

0 comments on commit 122d1ae

Please sign in to comment.