fix(transform): support batch transform temp table and scheduled buffer reset#8
fix(transform): support batch transform temp table and scheduled buffer reset#8ChihuaYing wants to merge 3 commits into
Conversation
ChihuaYing
commented
Jul 11, 2026
- 修复 Batch transform 输出 writer 未恢复的 bug
- 修复 Batch transform 读取后未清空缓冲区的 bug
- 支持 Batch transform 输出到临时表
- 新增 Batch transform 定时任务相关测试
2. 修复 Batch transform 读取后未清空缓冲区的 bug 3. 支持 Batch transform 输出到临时表 4. 新增 Batch transform 定时任务相关测试
There was a problem hiding this comment.
Pull request overview
Note
Copilot couldn't run its full agentic review because no GitHub Actions runner was available. Make sure your repository has a runner available to run Copilot's review, or add a copilot-setup-steps.yml file specifying one with the runs-on attribute. See the docs for more details.
This PR fixes Batch transform execution issues (writer restoration and buffer reset), adds support for writing Batch transform outputs into temporary tables (for subsequent SQL tasks), and introduces an integration test for scheduled batch transform behavior.
Changes:
- Fix BatchStageRunner to restore the correct writer and reset the collection buffer after reading.
- Update Job planning to optionally route Python batch outputs into a temp table via
outputPrefixwhen followed by an SQL task. - Add a scheduled batch transform YAML and a new integration test covering the scheduled + temp table flow.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| test/src/test/resources/transform/transformer_row_sum.py | Adjusts transformer output dtype to 64-bit integers. |
| test/src/test/resources/transform/TransformScheduledBatchTransform.yaml | Adds a scheduled batch-transform pipeline that writes to a temp table and then reads via SQL. |
| test/src/test/java/cn/edu/tsinghua/iginx/integration/func/udf/TransformIT.java | Adds an integration test verifying scheduled batch transform with temp table output. |
| core/src/main/java/cn/edu/tsinghua/iginx/transform/pojo/Job.java | Adds temp-table writer selection when a Python batch task with outputPrefix is followed by SQL. |
| core/src/main/java/cn/edu/tsinghua/iginx/transform/exec/BatchStageRunner.java | Restores writer initialization and clears the batch collection buffer after reading. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| CollectionWriter collectionWriter = | ||
| (CollectionWriter) batchStage.getBeforeStage().getExportWriter(); | ||
| BatchData batchData = collectionWriter.getCollectedData(); | ||
| collectionWriter.reset(); | ||
|
|
||
| mutex.lock(); | ||
| writer.writeBatch(batchData); |
| for (List<Object> row : queryResult.getValues()) { | ||
| assertEquals(expectedSum, row.get(sumIndex)); | ||
| } |
| try { | ||
| Thread.sleep(5000L); // wait for the scheduled job to run at least twice | ||
| verifyScheduledBatchTransformResult(44L); |
| - taskType: "sql" | ||
| timeout: 10000000 | ||
| sqlList: | ||
| - "SELECT s1, s1, s2 FROM batchsum.scheduleBatch;" |
2. 修复 Batch transform 读取后未清空缓冲区的 bug 3. 支持 Batch transform 输出到临时表 4. 新增 Batch transform 定时任务相关测试
…_20260709 # Conflicts: # test/src/test/java/cn/edu/tsinghua/iginx/integration/func/udf/TransformIT.java