Skip to content

Commit

Permalink
add test case
Browse files Browse the repository at this point in the history
Signed-off-by: before-Sunrise <[email protected]>
  • Loading branch information
before-Sunrise committed Jul 21, 2024
1 parent bd52779 commit dd80169
Show file tree
Hide file tree
Showing 6 changed files with 630 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public HashJoinNode(PlanNodeId id, PlanNode outer, PlanNode inner, JoinOperator
}

public boolean isSkewJoin() {
return isSkewJoin;
return isSkewJoin && ConnectContext.get().getSessionVariable().isEnableOptimizerSkewJoinByBroadCastSkewValues();
}

public void setSkewJoin(boolean skewJoin) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ public static void beforeClass() throws Exception {
connectContext.getGlobalStateMgr().setStatisticStorage(new MockHistogramStatisticStorage(scale));
GlobalStateMgr globalStateMgr = connectContext.getGlobalStateMgr();
connectContext.getSessionVariable().setEnableStatsToOptimizeSkewJoin(true);
connectContext.getSessionVariable().setEnableOptimizerSkewJoinByQueryRewrite(true);
connectContext.getSessionVariable().setEnableOptimizerSkewJoinByBroadCastSkewValues(false);

OlapTable t0 = (OlapTable) globalStateMgr.getDb("test").getTable("region");
setTableStatistics(t0, 5);
Expand Down
6 changes: 6 additions & 0 deletions test/sql/test_join/R/test_skew_join
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,12 @@ PROPERTIES (
);
-- result:
-- !result
set enable_optimize_skew_join_by_query_rewrite=true;
-- result:
-- !result
set enable_optimize_skew_join_by_broadcast_skew_values=false;
-- result:
-- !result
truncate table t1;
-- result:
-- !result
Expand Down
Loading

0 comments on commit dd80169

Please sign in to comment.