Sep 11, 2025: Support for Snowflake Cortex AI Functions in incremental dynamic table refresh¶
You can now use Snowflake Cortex AI Functions (including LLM functions) in the SELECT clause for dynamic tables in incremental refresh mode. The same availability restrictions as described in Cortex AI functions apply.
Cortex AI Functions let you add AI-powered insights directly to your dynamic tables, automatically analyzing data as it updates. For example, it can classify customer reviews, support tickets, or survey responses as positive/negative or assign categories.
In the following example, review_sentiment uses AI_FILTER to evaluate each review with an LLM. In AI_FILTER, the
prompt The reviewer enjoyed the restaurant with the actual review text. The output column enjoyed is the
classification generated by AI_FILTER based on the prompt, indicating whether the reviewer enjoyed the restaurant.
CREATE OR REPLACE TABLE reviews AS
SELECT 'Wow... Loved this place.' AS review
UNION ALL
SELECT 'The pizza is not good.' AS review;
CREATE OR REPLACE DYNAMIC TABLE review_sentiment
TARGET_LAG = DOWNSTREAM
WAREHOUSE = mywh
REFRESH_MODE = INCREMENTAL
AS
SELECT review, AI_FILTER(CONCAT('The reviewer enjoyed the restaurant', review), {'model': 'llama3.1-70b'}) AS enjoyed FROM reviews;