Before writing a CREATE AGGREGATION POLICY statement:
- Read
references/parameters.mdto review all available parameters and their defaults. - For each parameter, decide whether the user's request implies a non-default value.
- Include only the parameters that differ from the default or that the user explicitly requested.
- Never use
CREATE OR REPLACE— always useCREATE AGGREGATION POLICY IF NOT EXISTS. - The policy body must call either
NO_AGGREGATION_CONSTRAINT()(unrestricted access) orAGGREGATION_CONSTRAINT(MIN_GROUP_SIZE => <n>)(requires aggregation with at least n rows per group). - Aggregation policies require Snowflake Enterprise Edition or higher; warn the user if their account edition is unknown.
- The policy body cannot reference user-defined functions, tables, or views — only the built-in constraint functions are allowed.