[Bug] Support disable colocate join where join clause has join hint (#4497)
Fix issue:#4496
This commit is contained in:
@ -466,6 +466,12 @@ public class DistributedPlanner {
|
||||
return false;
|
||||
}
|
||||
|
||||
// If user have a join hint to use proper way of join, can not be colocate join
|
||||
if (node.getInnerRef().hasJoinHints()) {
|
||||
cannotReason.add("Has join hint");
|
||||
return false;
|
||||
}
|
||||
|
||||
PlanNode leftRoot = leftChildFragment.getPlanRoot();
|
||||
PlanNode rightRoot = rightChildFragment.getPlanRoot();
|
||||
|
||||
|
||||
@ -941,6 +941,10 @@ public class QueryPlanTest {
|
||||
String explainString = UtFrameUtils.getSQLPlanOrErrorMsg(connectContext, queryStr);
|
||||
Assert.assertTrue(explainString.contains("colocate: true"));
|
||||
|
||||
queryStr = "explain select * from test.colocate1 t1 join [shuffle] test.colocate2 t2 on t1.k1 = t2.k1 and t1.k2 = t2.k2";
|
||||
explainString = UtFrameUtils.getSQLPlanOrErrorMsg(connectContext, queryStr);
|
||||
Assert.assertTrue(explainString.contains("colocate: false"));
|
||||
|
||||
// t1.k1 = t2.k2 not same order with distribute column
|
||||
queryStr = "explain select * from test.colocate1 t1, test.colocate2 t2 where t1.k1 = t2.k2 and t1.k2 = t2.k1 and t1.k3 = t2.k3";
|
||||
explainString = UtFrameUtils.getSQLPlanOrErrorMsg(connectContext, queryStr);
|
||||
|
||||
Reference in New Issue
Block a user