featzhang commented on PR #27609:
URL: https://github.com/apache/flink/pull/27609#issuecomment-4188103104
## CI 失败根因分析
### 🔴 真实 Bug(不是基础设施问题)
CI 失败是因为 PR **修改了 `LogicalProject` 在 Abstract Syntax Tree (AST) plan 中的
explain 输出格式**,但只更新了部分测试快照文件,导致大量测试失败。
**失败的测试类:**
- `ChangelogModeInferenceTest`:9个失败
- `RemoveSingleAggregateRuleTest`:1个失败
- `SubqueryCorrelateVariablesValidationTest`:3个失败
- `JoinTest`:2个失败
- `DeltaJoinTest`:2个失败
- 共计 **17个** 测试失败
**错误示例:**
```
Expected (old format): LogicalProject(name=[sh], score=[], id=[])
+- LogicalFilter(condition=[>(, 5)])
+- LogicalTableScan(...)
but was (new format): LogicalProject(select=[name, score, id])
+- LogicalFilter(condition=[>(, 5)])
+- LogicalTableScan(...)
```
### 📊 问题规模
PR 修改了 `RelTreeWriterImpl.scala` 中的 `LogicalProject` explain 格式,影响所有包含
`LogicalProject` 的测试快照( 文件)。
当前仍有约 **995 处** XML 快照文件中的 `LogicalProject` 使用旧格式,需要全部更新。
### ✅ 修复建议
有两个方向:
**方案1(最小改动,推荐):** 撤销对 中修改 AST plan 格式的部分。只在 / 层(而非 AST 层)展示可读字段名,这样无需更新
XML 快照文件(因为 XML 里存的是 AST 部分)。
**方案2(更彻底但工作量大):** 运行测试并用 `-Dtest.generate-plan=true` 自动重新生成所有 XML
快照文件,一次性更新所有 995 处。可以用以下命令:
```bash
mvn test -pl flink-table/flink-table-planner -Dtest.generate-plan=true
-Dtest=ChangelogModeInferenceTest,JoinTest,...
```
### 💡 建议
鉴于修改 AST plan 格式会影响大量测试,建议评估是否值得这么大的改动代价。如果只是提高可读性,可以考虑只在 Optimized
Execution Plan 层面做改动(类似 PR #27612 做的 ChangelogMode 改进),这样影响范围更小。
--
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]