aglinxinyuan opened a new pull request, #5441: URL: https://github.com/apache/texera/pull/5441
### What changes were proposed in this PR? Adds `LogicalPlanSpec` covering `amber/src/main/scala/org/apache/texera/workflow/LogicalPlan.scala` — the user-facing logical workflow graph case class plus its companion factory. | Surface | Pinned | | --- | --- | | Construction | `LogicalPlan(operators, links)` exposes both fields verbatim. | | `LogicalPlan.apply(LogicalPlanPojo)` | Lifts the POJO's operators + links into a `LogicalPlan`, ignoring the POJO-only `opsToViewResult` / `opsToReuseResult` fields. | | `getTopologicalOpIds` | Topological order on a linear chain; respects edge directionality across a fan-out (`a → b, a → c`) — source first, two sinks unordered in the tail. | | `getOperator` | Returns the operator with the requested id; throws `NoSuchElementException` for an unknown id. | | `getTerminalOperatorIds` | Single sink in a linear chain; every out-degree-0 operator in a fan-out plan; every operator when there are no links; empty list for an empty plan. | | `getUpstreamLinks` | Returns every link whose `toOpId` matches the argument; preserves construction order when multiple links flow into the same target; returns an empty list when nothing flows in. | | `resolveScanSourceOpFileName` | Failures with `Some(errorList)` are appended per-operator instead of throwing; with `None` the first failure rethrows; non-`ScanSourceOpDesc` operators are left untouched (no errors, no resolution). Failures are forced deterministically by pointing a `ScanSourceOpDesc` fixture at a non-existent file path. | A happy-path `resolveScanSourceOpFileName` test is intentionally omitted: `FileResolver` reaches the LakeFS / dataset service in production and is environment-dependent, so a deterministic unit test would have to mock that surface — out of scope for this spec. No production code changed; this is test-only. ### Any related issues, documentation, discussions? Closes #5438 ### How was this PR tested? ``` sbt "WorkflowExecutionService/Test/testOnly org.apache.texera.workflow.LogicalPlanSpec" # → 16 tests, all pass sbt "WorkflowExecutionService/Test/scalafmtCheck" # → clean ``` ### Was this PR authored or co-authored using generative AI tooling? Generated-by: Claude Code (Claude Opus 4.7) -- 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]
