Skip to content

feat: send live result updates of every output port - #9272

Closed
sshiv012 wants to merge 2 commits into
apache:mainfrom
sshiv012:sshiv012/result-port-2-live-updates
Closed

sshiv012 wants to merge 2 commits into
apache:mainfrom
sshiv012:sshiv012/result-port-2-live-updates

Conversation

@sshiv012

@sshiv012 sshiv012 commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Stacked on #9271. This branch contains #9271's commit. Review only the last commit, feat: send live result updates of every output port, or its diff. I'll rebase once #9271 merges.

What changes were proposed in this PR?

#9054 lets a pagination request read any output port, but the live result updates still follow only an operator's first port. The frontend therefore can't tell that a later port has a result (a Split's second output, or a port holding a visualization) or that it changed. #9054 deliberately left live updates on the first port. This PR is the proposal to extend them, so feedback on the shape is welcome.

Backend

  • WebResultUpdateEvent gains a third field, portUpdates: Map[String, Map[Int, WebResultUpdate]] (operator id → port index → update), e.g. "portUpdates": {"Split-1": {"1": {...}}}.
  • It holds the ports past the first whose result is new or whose tuple count changed, using the same rule as the first port.
  • updates and tableStats keep their exact meaning: the first port only. Later ports get no table statistics.
  • Each port's update is built with that port's own output mode and document. For example, an HTML port 1 next to a table port 0 sends a snapshot, and a SET_DELTA port 1 sends only the rows added since its own previous count.

Frontend (WorkflowResultService only; no UI change)

  • Keeps a table service or a visualization service per later port, fed by portUpdates.
    • A port's table service is created from its live updates even when port 0 is not a table.
    • getPortPaginatedResultService returns undefined for a port that holds a visualization.
  • Emits on getResultInitiateStream() when a later port's result appears, or switches between table and visualization.
  • New getResultPortIndices(op): the ports that currently have a result. New getPortResultService(op, n) and getPortResultUpdateStream().
  • determineOutputTypes and determineOutputExtension take an optional portIndex. Port 0 behaves as before.
  • An event without portUpdates (from an older server) is accepted.

The result panel still shows the first port. Showing later ports is a separate PR, to be coordinated with #9052.

Any related issues, documentation, discussions?

Stacked on #9271. Builds on #9054. Part of discussion #8914. Related to #9052 (pinned windows).

How was this PR tested?

Backend specs in ExecutionResultServiceSpec:

  • a later port's update goes in portUpdates, never in updates;
  • only the later ports whose count changed are sent, and an operator with no changed later port has no key;
  • a moved change detector with an unchanged count is not resent;
  • a later port uses its own output mode and document: an HTML snapshot, a table behind an HTML first port, and SET_DELTA rows counted from that port's own previous count;
  • a later port that is not stored yet gets an empty pagination update.

TexeraWebSocketEventSpec checks the portUpdates JSON shape.

Frontend specs in workflow-result.service.spec.ts (+364 lines):

  • services are created and fed per port, and a port switching between table and visualization is handled and announced;
  • getResultPortIndices order, determineOutputTypes per port, and clearResults;
  • events without portUpdates are accepted.
sbt "WorkflowExecutionService/testOnly *ExecutionResultServiceSpec *WorkflowServiceSpec *TexeraWebSocketEventSpec"
sbt "WorkflowExecutionService/scalafmtCheck" "WorkflowExecutionService/Test/scalafmtCheck" "WorkflowExecutionService/scalafixAll --check"
cd frontend && npx ng test --watch=false     # 248 files, 7039 passed
npx prettier --check src/app/workspace/service/workflow-result/*.ts src/app/workspace/types/execute-workflow.interface.ts

Was this PR authored or co-authored using generative AI tooling?

Generated-by: Claude Code (Claude Opus 5.5)

🤖 Generated with Claude Code

https://claude.ai/code/session_01SRmgtBces67YppgKLHoZHa

@github-actions

github-actions Bot commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

Automated Reviewer Suggestions

Based on the git blame history of the changed files, we recommend the following reviewers:

  • Contributors with relevant context: @kz930, @aglinxinyuan, @mengw15
    You can notify them by mentioning @kz930, @aglinxinyuan, @mengw15 in a comment.

sshiv012 and others added 2 commits November 2, 2026 21:27
The result store had one entry per operator, filtered to the first output
port, and the diff handler took the output mode from the operator's first
external port. Any HTML (SINGLE_SNAPSHOT) port on an operator also skipped
the first port's table statistics and result size, even when the first
port was a table.

- WorkflowResultStore keys its entries by GlobalPortIdentity: one entry per
  external output port, each with its own tuple count. Internal ports are
  not entries.
- Each port's output mode is looked up for that port, and a result entry
  whose port is not in the physical plan fails loudly.
- The result size is recorded for every changed table port, under that
  port's id. Table statistics and the result updates sent to the frontend
  stay the first port's, so nothing on the wire changes.

Related: apache/texera discussion apache#8914.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01SRmgtBces67YppgKLHoZHa
apache#9054 lets a pagination request read any output port, but the live
result updates still follow only an operator's first port, so the
frontend cannot tell that a later port (a Split's second output, or a
port holding a visualization) has a result or that it changed.

- WebResultUpdateEvent gains portUpdates (operator id -> port index ->
  update) for the ports past the first whose result is new or whose tuple
  count changed. updates and tableStats keep their meaning (the first
  port). Each port's update is built with that port's own output mode and
  document.
- WorkflowResultService keeps a table or visualization service per later
  port from those updates, announces a port whose result appears or
  changes kind, and lists the ports that have a result
  (getResultPortIndices). determineOutputTypes and
  determineOutputExtension answer for a given port. An event without
  portUpdates (an older server) is accepted.

No UI change: the result panel still shows the first port.

Related: apache/texera discussion apache#8914.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01SRmgtBces67YppgKLHoZHa
@sshiv012
sshiv012 force-pushed the sshiv012/result-port-2-live-updates branch from 79be850 to abc35da Compare November 3, 2026 05:27
@codecov-commenter

codecov-commenter commented Nov 3, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 98.43750% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 92.18%. Comparing base (ae2203e) to head (abc35da).

Files with missing lines Patch % Lines
...service/workflow-result/workflow-result.service.ts 98.18% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff            @@
##               main    #9272   +/-   ##
=========================================
  Coverage     92.17%   92.18%           
  Complexity     4987     4987           
=========================================
  Files          1284     1284           
  Lines         55605    55652   +47     
  Branches       7120     7134   +14     
=========================================
+ Hits          51256    51301   +45     
  Misses         2591     2591           
- Partials       1758     1760    +2     
Flag Coverage Δ *Carryforward flag
access-control-service 77.44% <ø> (ø)
agent-service 99.54% <ø> (ø) Carriedforward from c2d2848
amber 86.84% <100.00%> (-0.01%) ⬇️
computing-unit-managing-service 64.02% <ø> (ø)
config-service 87.61% <ø> (ø)
file-service 82.29% <ø> (ø)
frontend 96.47% <98.18%> (-0.01%) ⬇️
notebook-migration-service 83.77% <ø> (ø)
pyamber 98.54% <ø> (ø) Carriedforward from c2d2848
workflow-compiling-service 77.95% <ø> (ø)

*This pull request uses carry forward flags. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions

github-actions Bot commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

✅ No material benchmark regressions detected

🟢 2 better · 🔴 0 worse · ⚪ 13 noise (<±5%) · 0 without baseline

Compared against main ae2203e benchmarked on this same runner, so the delta is largely free of cross-runner hardware noise. The "7d avg" column still reflects the gh-pages dashboard. Treat <±5% as noise unless repeated.

Dashboard · Run

config throughput MB/s latency max Δ latest / 7d
🟢 bs=10 sw=10 sl=64 391 0.239 24,474/34,221/34,221 us 🟢 -9.5% / 🔴 +141.0%
⚪ bs=100 sw=10 sl=64 822 0.502 120,778/136,453/136,453 us ⚪ within ±5% / 🔴 +41.5%
⚪ bs=1000 sw=10 sl=64 961 0.587 1,042,450/1,067,736/1,067,736 us ⚪ within ±5% / 🔴 -18.1%
Baseline details

Latest main ae2203e from same runner

config metric PR latest main 7d avg Δ latest Δ 7d
bs=10 sw=10 sl=64 throughput 391 tuples/sec 407 tuples/sec 880.32 tuples/sec -3.9% -55.6%
bs=10 sw=10 sl=64 MB/s 0.239 MB/s 0.248 MB/s 0.537 MB/s -3.6% -55.5%
bs=10 sw=10 sl=64 p50 24,474 us 24,265 us 11,404 us +0.9% +114.6%
bs=10 sw=10 sl=64 p95 34,221 us 37,794 us 14,198 us -9.5% +141.0%
bs=10 sw=10 sl=64 p99 34,221 us 37,794 us 17,818 us -9.5% +92.1%
bs=100 sw=10 sl=64 throughput 822 tuples/sec 856 tuples/sec 1,146 tuples/sec -4.0% -28.3%
bs=100 sw=10 sl=64 MB/s 0.502 MB/s 0.522 MB/s 0.7 MB/s -3.8% -28.3%
bs=100 sw=10 sl=64 p50 120,778 us 115,237 us 90,069 us +4.8% +34.1%
bs=100 sw=10 sl=64 p95 136,453 us 140,328 us 96,453 us -2.8% +41.5%
bs=100 sw=10 sl=64 p99 136,453 us 140,328 us 109,096 us -2.8% +25.1%
bs=1000 sw=10 sl=64 throughput 961 tuples/sec 952 tuples/sec 1,174 tuples/sec +0.9% -18.1%
bs=1000 sw=10 sl=64 MB/s 0.587 MB/s 0.581 MB/s 0.717 MB/s +1.0% -18.1%
bs=1000 sw=10 sl=64 p50 1,042,450 us 1,044,462 us 886,710 us -0.2% +17.6%
bs=1000 sw=10 sl=64 p95 1,067,736 us 1,119,685 us 933,314 us -4.6% +14.4%
bs=1000 sw=10 sl=64 p99 1,067,736 us 1,119,685 us 979,175 us -4.6% +9.0%
Raw CSV
config_idx,batch_size,schema_width,string_len,num_batches,total_ms,total_tuples,total_bytes,tuples_per_sec,mb_per_sec,lat_p50_us,lat_p95_us,lat_p99_us
0,10,10,64,20,511.40,200,128000,391,0.239,24474.12,34220.64,34220.64
1,100,10,64,20,2434.00,2000,1280000,822,0.502,120777.78,136453.40,136453.40
2,1000,10,64,20,20801.87,20000,12800000,961,0.587,1042450.16,1067735.59,1067735.59

@sshiv012

Copy link
Copy Markdown
Contributor Author

Folded into #9271, following review: there both PRs' changes use one per-port path for every output port, with no port-0 special case and no separate portUpdates field. Closing this draft.

🤖 Generated with Claude Code

@sshiv012 sshiv012 closed this Nov 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

common engine frontend Changes related to the frontend GUI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants