#8579·sqlfluff

Snowflake: ALTER CORTEX SEARCH SERVICE ... REFRESH is unparsable

Author: kovaacsCreated Sep 25, 2026Updated Sep 25, 2026
Labelssnowflake

Search before asking

  • I searched the issues and found no similar issues.

What Happened

The Snowflake dialect fails to parse the REFRESH form of ALTER CORTEX SEARCH SERVICE, which triggers a manual refresh of the search index (Snowflake docs):

sql
ALTER CORTEX SEARCH SERVICE [ IF EXISTS ] <name> REFRESH

AlterCortexSearchServiceStatementSegment covers SUSPEND/RESUME, SET, RENAME TO and ADD/DROP SCORING PROFILE, but not REFRESH.

Expected Behaviour

The statement parses as an alter_cortex_search_service_statement.

Observed Behaviour

==== parsing violations ====
L:   1 | P:   1 |  PRS | Line 1, Position 1: Found unparsable section: 'ALTER CORTEX SEARCH
                       | SERVICE mysvc REFRES...'
WARNING: Parsing errors found and dialect is set to 'snowflake'. Have you configured your dialect correctly?

Because the file contains an unparsable section, sqlfluff fix also skips every other fix in that file.

How to reproduce

test.sql:

sql
ALTER CORTEX SEARCH SERVICE mysvc REFRESH;
sqlfluff parse test.sql

Dialect

snowflake

Version

sqlfluff, version 4.3.0 Python 3.12.14

Configuration

.sqlfluff:

ini
[sqlfluff]
dialect = snowflake

Are you willing to work on and submit a PR to address the issue?

  • Yes I am willing to submit a PR!

Code of Conduct