Skip to content

Commit

Permalink
[case](mtmv) Failed to fix the case of concurrent insert overwrite ex… (
Browse files Browse the repository at this point in the history
  • Loading branch information
zddr authored Sep 24, 2024
1 parent a1429ef commit 3ad9dce
Showing 1 changed file with 10 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ suite("test_iot_auto_detect_concurrent") {
sql new File("""${context.file.parent}/ddl/test_iot_auto_detect_concurrent.sql""").text

def success_status = true
def err_msg = ""
def load_data = { range, offset, expect_success ->
try {
sql " use test_iot_auto_detect_concurrent; "
Expand All @@ -44,6 +45,7 @@ suite("test_iot_auto_detect_concurrent") {
success_status = false
log.info("fails one")
}
err_msg = e.getMessage()
log.info("successfully catch the failed insert")
return
}
Expand Down Expand Up @@ -105,10 +107,14 @@ suite("test_iot_auto_detect_concurrent") {
thread6.join()
thread7.join()
// suppose result: Success to overwrite with a multiple of ten values
assertTrue(success_status)
qt_sql3 " select count(k0) from test_concurrent_write; "
qt_sql4 " select count(distinct k0) from test_concurrent_write; "

if (!success_status) {
// Not allowed running Insert Overwrite on same table
assertTrue(err_msg.contains('same table'))
} else {
// The execution was fast, resulting in no concurrent execution
qt_sql3 " select count(k0) from test_concurrent_write; "
qt_sql4 " select count(distinct k0) from test_concurrent_write; "
}

/// with drop partition concurrently
success_status = true
Expand Down

0 comments on commit 3ad9dce

Please sign in to comment.