page224
310
Let’s now check what the stream recorded.
SELECT count(1),
metadata$action,
metadata$isupdate
FROM strm_part_customer_order_asia
WHERE region_name = 'ASIA'
GROUP BY metadata$action,
metadata$isupdate;
However, you find our stream registers a
DELETE
operation for all staged data, as
shown in Figure 8-22.
Figure 8-22.
Stream TRUNCATE data
You must purge the stream
DELETE
data before loading our next batch into the raw or
staging table. Snowflake does not provide capability to purge stream contents, but you
know a simple
SELECT
will not clear the stream content.
To clear stream contents you must
SELECT
all records using a dummy
INSERT
as this
next statement proves:
INSERT INTO part_customer_order_asia
SELECT *
FROM strm_part_customer_order_asia
WHERE 1 = 0;
Now recheck the stream contents.
SELECT count(1),
metadata$action,
metadata$isupdate
FROM strm_part_customer_order_asia
WHERE region_name = 'ASIA'
GROUP BY metadata$action,
metadata$isupdate;
You should see zero records.
Chapter 8
parallelization