[BugFix] Fix colocate group execution not found exec group (backport #62465) (#62548)

Co-authored-by: stdpain <34912776+stdpain@users.noreply.github.com>
This commit is contained in:
mergify[bot] 2025-09-09 14:48:54 +08:00 committed by GitHub
parent 1538f9d741
commit 5c87a1899f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 19 additions and 4 deletions

View File

@ -45,7 +45,14 @@ public class ExecGroupSets {
return execGroup;
}
}
Preconditions.checkState(false, "not found exec group node: %d", nodeId);
return null;
}
public ExecGroupId getExecGroupId(int nodeId) {
ExecGroup group = getExecGroup(nodeId);
if (group != null) {
return group.getGroupId();
}
return new ExecGroupId(-1);
}
}

View File

@ -269,7 +269,7 @@ public class RuntimeFilterDescription {
}
// colocate runtime filter couldn't apply to other exec groups
if (isBuildFromColocateGroup && joinMode.equals(COLOCATE)) {
int probeExecGroupId = rfPushCtx.getExecGroup(node.getId().asInt()).getGroupId().asInt();
int probeExecGroupId = rfPushCtx.getExecGroupId(node.getId().asInt()).asInt();
if (execGroupId != probeExecGroupId) {
return false;
}

View File

@ -41,7 +41,7 @@ public class RuntimeFilterPushDownContext {
return description;
}
public ExecGroup getExecGroup(int planNodeId) {
return this.execGroups.getExecGroup(planNodeId);
public ExecGroupId getExecGroupId(int planNodeId) {
return this.execGroups.getExecGroupId(planNodeId);
}
}

View File

@ -225,6 +225,14 @@ public class GroupExecutionPlanTest extends PlanTestBase {
querys.add("select distinct tb.k1,tb.k2,tb.k3,tb.k4 from (select l.k1 k1, l.k2 k2,r.k1 k3,r.k2 k4 " +
"from (select k1, k2 from colocate1 l) l join [bucket] colocate2 r on l.k1 = r.k1 and l.k2 = r.k2) tb " +
"join colocate1 z;");
// Colocate Join
// / \
// Bucket Shuffle Join Scan
// / \
// Scan Exchange
// Scan
querys.add("select * from colocate1 l left join [bucket] colocate2 r on l.k1=r.k1 and l.k2=r.k2 " +
"join [colocate] colocate2 z on l.k1=z.k1 and l.k2=z.k2;");
// CTE as probe runtime filter probe side
querys.add("with a as (select distinct k1, k2 from colocate1) " +
"select distinct l.k1,r.k2 from colocate1 l join [broadcast] a r on l.k1=r.k1 and l.k2=r.k2 " +