englefly commented on PR #67549:
URL: https://github.com/apache/doris/pull/67549#issuecomment-6166826416
按你上一条确认,把 `PhysicalStorageLayerAggregate` 那处丢 group 的问题修掉了(commit
`57c6bd097aa`):
- **根因**:`DefaultPlanRewriter.visitPhysicalStorageLayerAggregate` 在下面的 scan
被改写时用 `withPhysicalOlapScan(...)` 换掉 relation,而该方法用**三参构造**重建节点 —— 既没传
`groupExpression` 也没搬 `MutableState` ✗。
- **修法**:`withPhysicalOlapScan` 走 `AbstractPlan.rebuildKeepingStates(this,
copyWithSameId(this, () -> new PhysicalStorageLayerAggregate(scan, aggOp,
countArgumentExprIds, getGroupExpression(), getLogicalProperties(),
physicalProperties, statistics)))`,即把 group 回引与 states 一起带过去。
- **实测**:`select count(*) from hbo_test.hbo_sg_t1` 现在三个节点都有指纹 ——
```
[44] aggregation type=exact fingerprint='99fc3de8…' ← 存储层聚合(原来是 no group
for PhysicalStorageLayerAggregate)
[46] aggregation type=exact fingerprint='af66b7bf…' ← 未变
[48] aggregation type=exact fingerprint='af66b7bf…' ← 未变
```
- **顺手审计**:注解会打印的那几类节点(join / aggregate / filter / union / intersect /
except)的其它重建方法(`withChildren` / `withGroupExpression` /
`withGroupExprLogicalPropChildren`)都会带 group expression(构造参数或 `withChildren`
里的字段赋值),**只有这一处漏了**。
- **没有做**更激进的方案(把 states 复制直接内置进 `AbstractPlan.copyWithSameId`,它被所有
`withXxx` 使用):它同样被"为**新的** group expression 构造计划"的路径使用,搬过去的旧 group id 会指向旧
group ✗。
矩阵回归(未变):普通 join 与 `order by … limit` 压 join 仍同为 `9eeae21f…`,左孩子带 `limit 10`
仍为 `fb866bf3…`。`query_p0/hbo` 正在重跑,结果随后补。
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]