Matthew-DWM opened a new pull request, #9632:
URL: https://github.com/apache/texera/pull/9632
### What changes were proposed in this PR?
`WorkflowCompiler.expandLogicalPlan` found the source of each logical link
with `physicalPlan.getPhysicalOpsOfLogicalOp(fromOp)`, which builds a JGraphT
DAG of the whole plan so far and walks it in topological order. Every link paid
for that.
The compiler now records which physical op produces each `(logical op,
output port)` as it adds ops, and wires a link with one map lookup.
```
Before: link from Aggregate -> DAG of every physical op so far ->
topological walk -> globalAgg, port 0
After: link from Aggregate -> producers((Aggregate, port 0))
-> globalAgg, port 0
```
Internal ports are separate keys, so the first stage of Aggregate or Hash
Join, which writes to internal port 0, is never picked.
### Any related issues, documentation, discussions?
Closes #9631
### How was this PR tested?
- New `WorkflowCompilerProducerLookupSpec` (4 cases): links out of real
Aggregate and Hash Join operators and their storage ports, an operator whose
later internal link fails, a link from a missing port, and repeated links into
one port. They pass on main too.
- `sbt WorkflowCompiler/test`: 91 passed. Scalafmt and Scalafix checks pass.
- An out-of-tree check compiled 121 workflows with main and with this PR in
both modes. Plans, link order, schemas, errors and storage ports match for 119.
The other two are synthetic shapes no shipped operator produces: two physical
ops on the same output port (this PR picks the first added), and a reused
physical op ID that forms a cycle, which main caught at the next link.
Median editing-time compile on local machine with JDK 17, 5 JVMs × 20 runs
of main and this PR alternating after warmup:
| Workflow | main | This PR | Allocated per compile |
| --- | ---: | ---: | ---: |
| 16-operator chain | 0.60 ms | 0.31 ms | 0.50 → 0.26 MB |
| 64-operator chain | 10.8 ms | 3.9 ms | 6.7 → 2.3 MB |
| 36 Aggregates | 9.8 ms | 4.9 ms | 5.5 → 2.7 MB |
| 20 Hash Joins | 7.6 ms | 3.8 ms | 4.5 → 2.0 MB |
| 80 branches into a Union | 22.9 ms | 14.2 ms | 11.5 → 6.5 MB |
Strict mode moves the same way, and a one-link workflow is no slower.
### Was this PR authored or co-authored using generative AI tooling?
Generated-by: OpenAI Codex (GPT-6.2 Sol) and Claude Code (Claude Opus 5.5)
--
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]