Skip to content

feat: read the result of any output port of an operator - #9054

Merged
aglinxinyuan merged 3 commits into
apache:mainfrom
kz930:feat/9053-read-any-output-port
Oct 27, 2026
Merged

aglinxinyuan merged 3 commits into
apache:mainfrom
kz930:feat/9053-read-any-output-port

Conversation

@kz930

@kz930 kz930 commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

What changes were proposed in this PR?

Every external output port of an operator that keeps its result is stored, but results were only ever read from the first port, so a Split's second output or an If's True branch could not be shown.

A pagination request can now name the output port to read, with the first port as the default, and the reply carries the port it read and that port's row count. The live result updates keep following the first port, so a client paging another port takes the count from the reply. The result store's count per operator now comes from the first port too: it was built from every stored port, so a terminal Split's second output could replace its first output's count, and the result panel paged by the wrong number.

On the frontend, the result service gives each extra port its own pagination service, which names its port in its requests, keeps no page cache and takes its row count from each reply. Every port's service takes its schema only from replies to its own requests, since all replies share one stream. The result table and its row detail can show any port; nothing picks a port other than the first yet, which comes with the pinned windows in #9052.

Any related issues, documentation, discussions?

Closes #9050. Closes #9053. Part of #9052.

How was this PR tested?

New cases in ExecutionResultServiceSpec check that a request for each of an operator's two ports returns that port's rows and count, and that an operator with two stored ports is reported by its first port's count; the latter fails on main. PaginatedResultEventSpec checks the reply's new fields and that it serializes to exactly what the frontend declares. New cases in the result service's and the result table's specs cover the per-port services and requests. The backend specs above and the affected frontend specs pass.

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

Generated-by: Claude Code (Claude Opus 5.5)

🤖 Generated with Claude Code

@kz930

kz930 commented Oct 20, 2026

Copy link
Copy Markdown
Contributor Author

@carloea2 could you take a look at this when you have a chance? Thanks!

Every external output port of an operator that keeps its result is
stored, but results were only ever read from the first port, so a
Split's second output or an If's True branch could not be shown.

A pagination request can now name the output port to read, with the
first port as the default, and the reply carries the port it read and
that port's row count. The live result updates keep following the
first port, so a client paging another port takes the count from the
reply. The result store's count per operator now comes from the first
port too; it was built from every stored port, so a terminal Split's
second output could replace its first output's count.

On the frontend, the result service gives each extra port its own
pagination service, which names its port in its requests, keeps no
page cache and takes its row count from each reply, and every port's
service takes its schema only from replies to its own requests. The
result table and its row detail can show any port.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@kz930
kz930 force-pushed the feat/9053-read-any-output-port branch from de65175 to 8846756 Compare October 20, 2026 23:10
@kz930 kz930 changed the title feat(backend): read the result of any output port of an operator feat: read the result of any output port of an operator Oct 20, 2026

@carloea2 carloea2 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

110 frontend tests pass locally. Two added port-switching regressions fail at this head.

Switching the table to another output port left the previous port's
rows on screen when the new port was empty, with the loading state
never ending, and a late reply for the previous port could replace the
new port's rows. A port change now starts from an empty table, a reply
for an operator or port no longer shown is dropped, and an empty page
ends the loading.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@kz930

kz930 commented Oct 20, 2026

Copy link
Copy Markdown
Contributor Author

Thanks, both reproduced. Fixed in 13c1294: a port change now starts from an empty table and an empty reply ends the loading, and a reply is dropped if the operator or port it was requested for is no longer shown; the two cases are added as regression tests in result-table-frame.component.spec.ts.

@github-actions github-actions Bot added feature engine frontend Changes related to the frontend GUI labels Oct 20, 2026
@github-actions

github-actions Bot commented Oct 20, 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: @aglinxinyuan, @Ma77Ball, @yangzhang75
    You can notify them by mentioning @aglinxinyuan, @Ma77Ball, @yangzhang75 in a comment.

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 97.43590% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 92.33%. Comparing base (22b82a2) to head (13c1294).

Files with missing lines Patch % Lines
...result-table-frame/result-table-frame.component.ts 95.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main    #9054      +/-   ##
============================================
- Coverage     92.33%   92.33%   -0.01%     
+ Complexity     5045     5044       -1     
============================================
  Files          1261     1261              
  Lines         54120    54141      +21     
  Branches       6768     6779      +11     
============================================
+ Hits          49974    49993      +19     
  Misses         2486     2486              
- Partials       1660     1662       +2     
Flag Coverage Δ *Carryforward flag
access-control-service 77.38% <ø> (ø) Carriedforward from 22b82a2
agent-service 99.16% <ø> (ø) Carriedforward from 22b82a2
amber 87.31% <ø> (-0.01%) ⬇️ Carriedforward from 22b82a2
computing-unit-managing-service 60.48% <ø> (ø) Carriedforward from 22b82a2
config-service 87.37% <ø> (ø) Carriedforward from 22b82a2
file-service 82.00% <ø> (ø) Carriedforward from 22b82a2
frontend 96.55% <97.43%> (-0.01%) ⬇️
notebook-migration-service 83.73% <ø> (ø) Carriedforward from 22b82a2
pyamber 98.57% <ø> (ø) Carriedforward from 22b82a2
workflow-compiling-service 72.43% <ø> (ø) Carriedforward from 22b82a2

*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.

@carloea2 carloea2 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both port-switching findings are fixed. All 112 focused frontend tests and 75 backend tests pass on fresh upstream main, including empty ports and late replies. Focused frontend formatting, lint and scalafmtCheckAll pass. Code looks good. This needs rebasing after #8766: both touch ExecutionResultService and ResultTableFrame, and the merge currently conflicts in those two files. Current backend CI stops at the Ampel action allowlist.

Resolve the conflicts with apache#8766: a page with no rows takes its columns
from the stored schema, and the reply still carries the port's total
count and is dropped when it belongs to another operator or port.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@github-actions

Copy link
Copy Markdown
Contributor

✅ No material benchmark regressions detected

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

Compared against main 8fbd4f2 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 498 0.304 19,487/24,443/24,443 us 🟢 -61.0% / 🔴 +99.9%
⚪ bs=100 sw=10 sl=64 1,228 0.75 80,866/99,776/99,776 us ⚪ within ±5% / 🔴 +14.5%
⚪ bs=1000 sw=10 sl=64 1,402 0.856 699,903/814,900/814,900 us ⚪ within ±5% / 🟢 -10.3%
Baseline details

Latest main 8fbd4f2 from same runner

config metric PR latest main 7d avg Δ latest Δ 7d
bs=10 sw=10 sl=64 throughput 498 tuples/sec 394 tuples/sec 1,019 tuples/sec +26.4% -51.1%
bs=10 sw=10 sl=64 MB/s 0.304 MB/s 0.241 MB/s 0.622 MB/s +26.1% -51.1%
bs=10 sw=10 sl=64 p50 19,487 us 19,152 us 10,144 us +1.7% +92.1%
bs=10 sw=10 sl=64 p95 24,443 us 62,750 us 12,225 us -61.0% +99.9%
bs=10 sw=10 sl=64 p99 24,443 us 62,750 us 15,527 us -61.0% +57.4%
bs=100 sw=10 sl=64 throughput 1,228 tuples/sec 1,196 tuples/sec 1,371 tuples/sec +2.7% -10.4%
bs=100 sw=10 sl=64 MB/s 0.75 MB/s 0.73 MB/s 0.837 MB/s +2.7% -10.4%
bs=100 sw=10 sl=64 p50 80,866 us 80,954 us 79,910 us -0.1% +1.2%
bs=100 sw=10 sl=64 p95 99,776 us 103,056 us 87,155 us -3.2% +14.5%
bs=100 sw=10 sl=64 p99 99,776 us 103,056 us 106,643 us -3.2% -6.4%
bs=1000 sw=10 sl=64 throughput 1,402 tuples/sec 1,460 tuples/sec 1,415 tuples/sec -4.0% -0.9%
bs=1000 sw=10 sl=64 MB/s 0.856 MB/s 0.891 MB/s 0.864 MB/s -3.9% -0.9%
bs=1000 sw=10 sl=64 p50 699,903 us 686,035 us 780,407 us +2.0% -10.3%
bs=1000 sw=10 sl=64 p95 814,900 us 776,888 us 817,814 us +4.9% -0.4%
bs=1000 sw=10 sl=64 p99 814,900 us 776,888 us 848,683 us +4.9% -4.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,401.76,200,128000,498,0.304,19486.98,24442.91,24442.91
1,100,10,64,20,1628.30,2000,1280000,1228,0.750,80865.64,99775.97,99775.97
2,1000,10,64,20,14266.20,20000,12800000,1402,0.856,699903.18,814899.71,814899.71

@aglinxinyuan
aglinxinyuan added this pull request to the merge queue Oct 27, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Oct 27, 2026
@aglinxinyuan
aglinxinyuan added this pull request to the merge queue Oct 27, 2026
Merged via the queue into apache:main with commit 6a6e8dc Oct 27, 2026
25 checks passed
sshiv012 added a commit to sshiv012/texera that referenced this pull request Nov 3, 2026
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
renovate-bot pushed a commit to renovate-bot/apache-_-texera that referenced this pull request Nov 12, 2026
…tput port (apache#9063)

### What changes were proposed in this PR?

The hover card gets a Pin button. Pinning turns it into a window beside
the operator with the whole result table, tied to the operator by a
dashed line. Several windows can be open at once; each can be dragged
and resized, and follows its operator when it or the canvas moves.

An operator with more than one output gets a tab per output port in its
window. The first port is the one the running execution reports on.
Another port is read when its tab is shown, through the port-aware
result service from apache#9054, and pages by the row count its replies carry.
The execution reports a change only for the first port, so another port
is read again as results arrive, at most once a second, and once more
when the operator completes. If the chosen output is removed, the window
shows the last one that is left. The table in a window fills the window:
it measures the space its search bar, header, statistics row and pager
take, and fits as many rows as are left. It shows its statistics row
only when a column has statistics, which another port never has.

<img width="1316" height="907" alt="pr3-2-pinned-output-1"
src="https://github.com/user-attachments/assets/788964bb-14bd-4a35-853d-6e2743ab0ae9"
/>

<img width="1447" height="840" alt="pr3-3-pinned-output-2"
src="https://github.com/user-attachments/assets/e6495a79-c117-488c-8434-41da58e42914"
/>

### Any related issues, documentation, discussions?

Closes apache#9062. Part of apache#9052. Design discussed in apache#8842.

### How was this PR tested?

A new spec for the pinned window covers its port tabs, the port it shows
and the height it hands the table. New cases in the result table's spec
cover filling a given height, the statistics row, and refreshing a port
past the first. New cases in the editor's spec cover pinning, unpinning,
unpinning a deleted operator's window, the window's position as the
canvas moves, and the connector line on each side. The affected frontend
specs pass. In the running app, a Split of 20 rows into 13 and 7 shows
the first output's 13 rows in its first tab and the other 7 in its
second, each paged correctly, and the pager ends near the window's
bottom edge at any window size. A window pinned on a Split's second
output during a run shows its rows when the run ends, and shows the new
rows after a re-run.

### 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.com/claude-code)

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

engine feature frontend Changes related to the frontend GUI

Projects

None yet

4 participants