Repository navigation
feat: read the result of any output port of an operator - #9054
Conversation
|
@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]>
de65175 to
8846756
Compare
carloea2
left a comment
There was a problem hiding this comment.
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]>
|
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 |
Automated Reviewer SuggestionsBased on the
|
Codecov Report❌ Patch coverage is
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
*This pull request uses carry forward flags. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
carloea2
left a comment
There was a problem hiding this comment.
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]>
✅ No material benchmark regressions detected🟢 4 better · 🔴 0 worse · ⚪ 11 noise (<±5%) · 0 without baseline
Baseline detailsLatest main
Raw CSVconfig_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 |
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
…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]>
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
ExecutionResultServiceSpeccheck 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.PaginatedResultEventSpecchecks 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