Sep 11, 2025: Support for Snowflake Cortex AISQL in incremental dynamic table refresh

You can now use Snowflake Cortex AISQL (including LLM functions) in the SELECT clause for dynamic tables in incremental refresh mode. The same availability restrictions as described in AISQL functions apply.

Cortex AISQL lets 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 SNOWFLAKE.CORTEX.AI_FILTER to evaluate each review with an LLM. Cortex AISQL combines the prompt The reviewer enjoyed the restaurant with the actual review text. The output column enjoyed is the classification generated using Cortex AISQL 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, SNOWFLAKE.CORTEX.AI_FILTER(CONCAT('The reviewer enjoyed the restaurant', review), {'model': 'llama3.1-70b'}) AS enjoyed FROM reviews;
Copy