How-to
Query a topic with Flink SQL
No SQL writing needed — the pre-filled query does the work
What you'll achieve
A live look at a topic's data through Flink — rows streaming into a table as they arrive — without writing a line of SQL: the query is pre-filled for you.
Before you start
- Your role badge says Developer or higher — viewers don't get the query button.
- A Flink compute pool exists in your environment. If the button is greyed out saying "No Flink compute pool exists in this context — an admin must create one to query with Flink SQL." — that's exactly what to ask your team's admin for.
Steps
- Click Topics in the sidebar, open your topic, and go to the Messages tab.
- Click Query with Flink SQL (next to the Fetch button). If your team has several compute pools, pick one under Run on compute pool.
- The SQL Workspace opens with the query already typed for you — something like
SELECT * FROM `your-topic`;. You don't need to touch it. - Click Run (or press ⌘/Ctrl+Enter).
- Watch the rows stream in. When you've seen enough, click Stop — or simply leave the page; your query is stopped automatically.
What success looks like
Rows appear in a live table under the editor with a small "streaming" indicator. The newest 500 rows are kept (older ones scroll away — you'll see "showing last 500 rows"). In the default Once mode the query finishes by itself and shows "finished"; switch Mode to Continuous to keep watching new data arrive until you stop it.
Something went wrong?
- "Waiting for the first rows…" just sits there — the topic may simply be empty right now. Check with View messages on a topic.
- An amber note: "This query was stopped after sitting idle, to free up resources. Run it again to continue." — nothing is wrong; the platform stops forgotten queries. Click Run again.
- A red message — the query failed; read the text, and if it doesn't help, contact the platform team.
- Worried about leaving something running? Don't be: leaving the page stops your query, and the idle safety net catches anything that slips through.
Want to go further — filters, joins, your own SQL? The Flink guide covers the full workspace. Prefer no SQL at all? See Apply a topic action.