Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
924060929 committed Jun 20, 2024
1 parent bb11671 commit 93ba8aa
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ suite("colocate_union_numbers") {
log.info(explainStr)

// union all with two exchange
assertTrue(explainStr.count("VEXCHANGE") == 2)
assertTrue(explainStr.count("VEXCHANGE") > 1)
assertTrue(explainStr.count("VDataGenScanNode") == 2)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,14 @@ suite("prune_bucket_with_bucket_shuffle_join") {
set disable_join_reorder=true;
"""

def assertJoinType = { String sqlStr, String containsString, int expectExchangeNum ->
def assertExplain = { String sqlStr, String containsString, Closure<Integer> checkExchangeNum ->
explain {
sql sqlStr
check { result ->
log.info("Explain result:\n${result}")

assertTrue(result.contains(containsString))
assertEquals(expectExchangeNum, result.count("VEXCHANGE"))
checkExchangeNum(result.count("VEXCHANGE"))
}
}
}
Expand All @@ -58,14 +58,18 @@ suite("prune_bucket_with_bucket_shuffle_join") {
ON a.c0 = b.c0
"""

assertJoinType(sqlStr, "RIGHT OUTER JOIN(PARTITIONED)", 2)
assertExplain(sqlStr, "RIGHT OUTER JOIN(PARTITIONED)") { exchangeNum ->
assertTrue(exchangeNum > 1)
}

multi_sql """
set enable_nereids_distribute_planner=true;
set enable_pipeline_x_engine=true;
set disable_join_reorder=true;
"""
assertJoinType(sqlStr, "RIGHT OUTER JOIN(BUCKET_SHUFFLE)", 1)
assertExplain(sqlStr, "RIGHT OUTER JOIN(BUCKET_SHUFFLE)") { exchangeNum ->
assertTrue(exchangeNum == 1)
}

explain {
sql "distributed plan ${sqlStr}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,18 @@ suite("shuffle_left_join") {
set disable_join_reorder=true;
"""

def assertExplain = { String sqlStr, String containsString, Closure<Integer> checkExchangeNum ->
explain {
sql sqlStr
check { result ->
log.info("Explain result:\n${result}")

assertTrue(result.contains(containsString))
checkExchangeNum(result.count("VEXCHANGE"))
}
}
}

def sqlStr = """
select *
from test_shuffle_left a
Expand All @@ -46,16 +58,8 @@ suite("shuffle_left_join") {
on a.id2=b.id;
"""

explain {
sql sqlStr
check { explainStr ->
log.info(explainStr)

assertTrue(explainStr.contains("INNER JOIN(PARTITIONED)"))

// union all with two exchange
assertTrue(explainStr.count("VEXCHANGE") == 2)
}
assertExplain(sqlStr, "INNER JOIN(PARTITIONED)") { exchangeNum ->
assertTrue(exchangeNum > 1)
}

order_qt_shuffle_left_and_right sqlStr
Expand All @@ -66,16 +70,8 @@ suite("shuffle_left_join") {
set disable_join_reorder=true;
"""

explain {
sql sqlStr
check { explainStr ->
log.info(explainStr)

assertTrue(explainStr.contains("INNER JOIN(PARTITIONED)"))

// union all with one exchange
assertTrue(explainStr.count("VEXCHANGE") == 1)
}
assertExplain(sqlStr, "INNER JOIN(PARTITIONED)") { exchangeNum ->
assertTrue(exchangeNum == 1)
}

order_qt_shuffle_left sqlStr
Expand Down

0 comments on commit 93ba8aa

Please sign in to comment.