In this example, the described statement joins the pageviewsStream and users1Changelog changelog before filtering and writing its results into the temporaljoin stream:
demodb.public/demostore# DESCRIBE CREATE STREAM temporaljoin AS SELECT p.userid AS pvuid, u.userid, u.gender, p.pageid, u.interests[1] AS top_interest FROM pageviews p JOIN "users1Changelog" u ON u.userid = p.userid WHERE p.userid != 'User_5';
+------------------+------------------------------------------+
| Type | Info |
+==================+==========================================+
| CREATE_STREAM_AS | {"ddl":{"fqn":"d39511ce-c918-4637-9524-1 |
| | 63183452274.demodb.public.temporaljoin", |
| | "type":"STREAM","db_name":"demodb","sche |
| | ma_name":"public","name":"temporaljoin", |
| | "store_name":"demostore"},"sources":[{"f |
| | qn":"d39511ce-c918-4637-9524-16318345227 |
| | 4.demodb.public.pageviews","type":"STREA |
| | M","db_name":"demodb","schema_name":"pub |
| | lic","name":"pageviews","store_name":"de |
| | mostore"},{"fqn":"d39511ce-c918-4637-952 |
| | 4-163183452274.demodb.public.users1Chang |
| | elog","type":"CHANGELOG","db_name":"demo |
| | db","schema_name":"public","name":"users |
| | 1Changelog","store_name":"demostore"}]} |
+------------------+------------------------------------------+
Describe an INSERT INTO statement
The example below shows that the statement filters the pageviews stream and writes its results into the existing relation called pageviews_6 of type stream: