Sep 11, 2025: Support for Snowflake Cortex AI Functions in incremental dynamic table refresh¶
现在,您可以在增量刷新模式下的动态表中使用 SELECT 子句的 Snowflake Cortex AI Functions (including LLM functions)。适用与 Cortex AI functions 中描述的相同可用性限制。
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;