Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Snowflake Dynamic Table support for`UNION ALL`

While trying to modify an existing table to be a Dynamic table, I noticed that it was not incrementally refreshing like I had hoped. refresh_mode_reason is given as below.

Change tracking is not supported on queries with UNION ALLs or outer joins that would produce conflicting ROW_IDs.

However, within the table in Understanding dynamic table refresh: Types of queries that support incremental refreshes it says:

Dynamic tables support UNION ALL.

theories

  1. Behind-the-scenes Snowflake determines whether the UNION ALL results in "conflicting ROW_IDs, if so, only full refresh is supported
  2. the docs are misleading and should really say: "Dynamic tables support UNION ALL, but not incremental refresh"
  3. Or is this a bug with dynamic tables?

related questions

Dynamic tables with UNION -- change tracking not enabled

like image 768
Anders Swanson Avatar asked Aug 22 '26 20:08

Anders Swanson


1 Answers

It looks like incremental updates do not support UNION, but they do support UNION ALL as mentioned in the documentation that you added. The difference is that UNION doesn't allow for duplicates.

like image 89
Kraig Helmeczi Avatar answered Aug 25 '26 14:08

Kraig Helmeczi



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!