Integration Architect (Presenter)
Principal Developer Advocate (Author)
Push and pull queries are easier to understand if you view them in action.
This exercise continues with the PERSON_STATS
table from Hands On: Stateful Aggregations (Materialized Views).
Issue a pull query on the PERSON_STATS
table:
SELECT LATEST_LOCATION, LOCATION_CHANGES, UNIQUE_LOCATIONS
FROM PERSON_STATS WHERE PERSON = 'Allison';
Click Run query and view the returned LATEST_LOCATION
, LOCATION_CHANGES
, and UNIQUE_LOCATIONS
.
Now issue a push query on the PERSON_STATS
table:
SELECT LATEST_LOCATION, LOCATION_CHANGES, UNIQUE_LOCATIONS
FROM PERSON_STATS WHERE PERSON = 'Allison' EMIT CHANGES;
Next, in another window, or perhaps in the CLI, insert some more data into the MOVEMENTS
stream on which the PERSON_STATS
table is based:
INSERT INTO MOVEMENTS VALUES ('Robin', 'York');
INSERT INTO MOVEMENTS VALUES ('Robin', 'Leeds');
INSERT INTO MOVEMENTS VALUES ('Allison', 'Denver');
INSERT INTO MOVEMENTS VALUES ('Robin', 'Ilkley');
INSERT INTO MOVEMENTS VALUES ('Allison', 'Boulder');
You should see new entries, reflecting this new data, appearing in the results of the push query from step 2.
Kill the query with Stop. Push queries will run until they're manually killed.
We will only share developer content and updates, including notifications when new content is added. We will never send you sales emails. 🙂 By subscribing, you understand we will process your personal information in accordance with our Privacy Statement.