Skip to content

Summarize web requests

tutorial
TL;DR

Run this small SQL dataset in an authorized test streaming catalog and compare the query result with the expected values. Use PGWire for both insertion and recent-data reads. Insert once, allow for the commit cycle and reconcile any uncertain write before repeating it; identifiers alone do not provide deduplication.

Input and resultCount requests by their HTTP status
Count requests by their HTTP status1: 200; 2: 401; 3: 200. Grouping the example rows produces 200: 2; 401: 1.Input rows from the exampleevent_idstatus_code120024013200COUNT(*)Expected result20024011Count requests by their HTTP status1: 200; 2: 401; 3: 200. Grouping the example rows produces 200: 2; 401: 1.Input rows from the exampleevent_idstatus_code120024013200COUNT(*)Expected result20024011
These are the actual example inputs and expected aggregates, not throughput measurements. Verify the SQL result before expanding the example.

Complete the first workflow connection with permission to create tables in a test streaming catalog. Use an unused table name and run the INSERT once.

SQL
CREATE TABLE main.access_logs (
event_id BIGINT,
event_time TIMESTAMP,
path VARCHAR,
status_code INTEGER
);
INSERT INTO main.access_logs VALUES
(1, TIMESTAMP '2026-01-01 12:00:00', '/home', 200),
(2, TIMESTAMP '2026-01-01 12:00:01', '/login', 401),
(3, TIMESTAMP '2026-01-01 12:00:02', '/home', 200);
SELECT status_code, COUNT(*) AS requests
FROM main.access_logs
GROUP BY status_code
ORDER BY status_code;

Expected result after the rows are visible: status 200 has two requests; 401 has one.

Wait only by repeating SELECT within a bounded period. Check the selected catalog and any earlier inserts. After a lost connection, preserve the input and reconcile before retrying. See completion rules.