Non-deterministic aggregate functions in Snowflake Dynamic Tables
Snowflake now supports functions like APPROX_COUNT_DISTINCT in incremental refresh for Dynamic Tables.
O que mudou
Use cases
Imagine you maintain a dynamic table that calculates approximate volume metrics and you need the refresh to run incrementally without full reprocessing. You can now use approximate aggregate functions directly in Dynamic Tables using INCREMENTAL, AUTO, or ADAPTIVE refresh modes.
- Build Dynamic Tables that rely on approximate counts and percentiles.
- Process large datasets more efficiently while keeping incremental updates.
How to use
CREATE OR REPLACE DYNAMIC TABLE my_dynamic_table
TARGET_LAG = '1 hour'
WAREHOUSE = my_warehouse
AS
SELECT
category,
APPROX_COUNT_DISTINCT(user_id) AS approximate_users,
APPROX_PERCENTILE(amount, 0.95) AS p95_amount
FROM my_base_table
GROUP BY category;
What happens in this code:
- Creates a Dynamic Table named
my_dynamic_table. - Sets the refresh lag target to one hour.
- Uses
APPROX_COUNT_DISTINCTandAPPROX_PERCENTILEfunctions within theSELECTclause alongside aGROUP BYclause.
Limitations and requirements
- Generally Available (GA).
- Supported in INCREMENTAL, AUTO, and ADAPTIVE refresh modes.
- Functions must be used only in the
SELECTclause for incremental refresh. - Supported functions include
APPROX_COUNT_DISTINCT,APPROX_PERCENTILE, andAPPROX_TOP_K. ANY_VALUEremains unsupported for incremental refresh.
- dynamic tables
- incremental refresh
- sql
- aggregate functions
- snowflake
Non-deterministic aggregate functions are supported with dynamic table incremental refresh (General availability)
Resumo e explicação gerados por IA a partir da release note oficial. Em caso de dúvida, a documentação oficial da plataforma prevalece.
Relacionadas
- SnowflakeGA
Geração de documentos em PDF, Word e PowerPoint no Snowflake CoWork
O Snowflake CoWork agora gera arquivos PDF, Word, PowerPoint e HTML diretamente de suas análises usando a ferramenta de execução de código do Cortex Agent.
snowflake cowork · cortex agent - SnowflakePublic Preview
Cortex Agent SDK para Python e TypeScript no Snowflake
O Cortex Agent SDK permite criar aplicações que utilizam Cortex Agents e Cortex Code em Python e TypeScript.
cortex agents · python - SnowflakeAtualização
Mensagens de erro mais detalhadas na classificação de dados sensíveis
A view DATA_CLASSIFICATION_LATEST agora traz mensagens de erro específicas e códigos do Snowflake para falhas na classificação.
data governance · trust center