Skip to content

Commit

Permalink
parser, planner, executor: remove non-mpp broadcast Join (#31459)
Browse files Browse the repository at this point in the history
close #31465
  • Loading branch information
SeaRise authored Mar 10, 2022
1 parent aca0970 commit 469bc71
Show file tree
Hide file tree
Showing 27 changed files with 854 additions and 1,104 deletions.
11 changes: 9 additions & 2 deletions executor/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -3101,7 +3101,10 @@ func buildNoRangeTableReader(b *executorBuilder, v *plannercore.PhysicalTableRea
if err != nil {
return nil, err
}
ts := v.GetTableScan()
ts, err := v.GetTableScan()
if err != nil {
return nil, err
}
if err = b.validCanReadTemporaryOrCacheTable(ts.Table); err != nil {
return nil, err
}
Expand Down Expand Up @@ -3205,7 +3208,11 @@ func (b *executorBuilder) buildTableReader(v *plannercore.PhysicalTableReader) E
return nil
}

ts := v.GetTableScan()
ts, err := v.GetTableScan()
if err != nil {
b.err = err
return nil
}
if err = b.validCanReadTemporaryOrCacheTable(ts.Table); err != nil {
b.err = err
return nil
Expand Down
4 changes: 0 additions & 4 deletions executor/tiflash_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,6 @@ func TestReadUnsigedPK(t *testing.T) {

tk.MustExec("set @@session.tidb_isolation_read_engines=\"tiflash\"")
tk.MustExec("set @@session.tidb_allow_mpp=ON")
tk.MustExec("set @@session.tidb_opt_broadcast_join=ON")
// mock executor does not support use outer table as build side for outer join, so need to
// force the inner table as build side
tk.MustExec("set tidb_opt_mpp_outer_join_fixed_build_side=1")
Expand Down Expand Up @@ -345,7 +344,6 @@ func TestTiFlashPartitionTableShuffledHashJoin(t *testing.T) {
}

tk.MustExec("SET tidb_enforce_mpp=1")
tk.MustExec("SET tidb_opt_broadcast_join=0")
tk.MustExec("SET tidb_broadcast_join_threshold_count=0")
tk.MustExec("SET tidb_broadcast_join_threshold_size=0")
tk.MustExec("set @@session.tidb_isolation_read_engines='tiflash'")
Expand Down Expand Up @@ -489,7 +487,6 @@ func TestPartitionTable(t *testing.T) {

tk.MustExec("set @@session.tidb_isolation_read_engines=\"tiflash\"")
tk.MustExec("set @@session.tidb_allow_mpp=ON")
tk.MustExec("set @@session.tidb_opt_broadcast_join=ON")
// test if it is really work.
failpoint.Enable("github.com/pingcap/tidb/executor/checkTotalMPPTasks", `return(8)`)
tk.MustQuery("select count(*) from t1 , t where t1.a = t.a").Check(testkit.Rows("4"))
Expand Down Expand Up @@ -1025,7 +1022,6 @@ func TestTiFlashPartitionTableBroadcastJoin(t *testing.T) {
}
tk.MustExec("set @@session.tidb_isolation_read_engines='tiflash'")
tk.MustExec("set @@session.tidb_enforce_mpp=1")
tk.MustExec("set @@session.tidb_opt_broadcast_join=ON")
// mock executor does not support use outer table as build side for outer join, so need to
// force the inner table as build side
tk.MustExec("set tidb_opt_mpp_outer_join_fixed_build_side=1")
Expand Down
2 changes: 1 addition & 1 deletion parser/ast/misc.go
Original file line number Diff line number Diff line change
Expand Up @@ -3430,7 +3430,7 @@ func (n *TableOptimizerHint) Restore(ctx *format.RestoreCtx) error {
ctx.WritePlainf("%d", n.HintData.(uint64))
case "nth_plan":
ctx.WritePlainf("%d", n.HintData.(int64))
case "tidb_hj", "tidb_smj", "tidb_inlj", "hash_join", "merge_join", "inl_join", "broadcast_join", "broadcast_join_local", "inl_hash_join", "inl_merge_join":
case "tidb_hj", "tidb_smj", "tidb_inlj", "hash_join", "merge_join", "inl_join", "broadcast_join", "inl_hash_join", "inl_merge_join":
for i, table := range n.Tables {
if i != 0 {
ctx.WritePlain(", ")
Expand Down
Loading

0 comments on commit 469bc71

Please sign in to comment.