ahmedabu98 opened a new pull request, #41408:
URL: https://github.com/apache/beam/pull/41408
Fixes #41313
#41315 made unbounded SELECTs return rows while the pipeline runs. This PR
adds a full-screen view on top of that, much like the changelog mode in Flink's
SQL client.
When the shell runs in a terminal, a streaming (unbounded) SELECT opens the
view:
- The column names stay pinned at the top, and new rows come in at the
bottom.
- An `op` column shows each row's change kind: `+I`, `-U`, `+U` or `-D`. It
comes from each element's `ValueKind`, so a Kafka or Pub/Sub read shows `+I`
for every row.
- You can scroll back through the newest 10,000 rows with the arrow keys,
PgUp and PgDn, Home and End, or vi keys. Scrolling up pauses the view, and End
goes back to live.
- `q`, Esc or Ctrl+C closes the view and cancels the pipeline.
```sql
SELECT * FROM CHANGES(customers) WITH ('streaming' = true);
```
```
Beam SQL live results RUNNING 01:15
op │ id │ name │ tier
─────┼──────┼───────┼───────
+I │ 1 │ alice │ silver
+I │ 2 │ bob │ gold
-U │ 1 │ alice │ silver
+U │ 1 │ alice │ gold
-D │ 2 │ bob │ gold
5 rows · live ↑↓ PgUp PgDn Home End ←→ scroll · q quit
```
The view draws with JLine 3 in its own terminal, while sqlline keeps its
jline2 line editor. It leaves signal handling to the shell, so Ctrl+C still
cancels the query. Without a terminal, for example when output is piped, the
shell keeps printing rows the plain way.
--
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]