Count application events
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.
Prerequisites
Section titled “Prerequisites”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.
Application events
Section titled “Application events”CREATE TABLE main.app_events ( event_id BIGINT, user_id VARCHAR, event_type VARCHAR);
INSERT INTO main.app_events VALUES (1, 'alice', 'view'), (2, 'alice', 'click'), (3, 'bob', 'view');
SELECT user_id, COUNT(*) AS eventsFROM main.app_eventsGROUP BY user_idORDER BY user_id;Expected result: alice has two events and bob has one. Use a
streaming view to filter future arrivals
into a derived stream; a normal query does not create one.
If the result differs
Section titled “If the result differs”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.