Is your feature request related to a problem? Please describe.
I'm trying to convert tables created by SQLMesh into columnar storage on MS SQL Server, but SQLGlot produces a ParseError on CREATE CLUSTERED COLUMNSTORE INDEX index_name ON { database_name.schema_name.table_name | schema_name.table_name | table_name }.
Describe the solution you'd like
If SQLGlot can parse this command, it would help speed up downstream model evaluation in SQLMesh a lot, and save significant storage space (approximate compression ratio 10:1).
Describe alternatives you've considered
CREATE INDEX for a normal rowstore index can be parsed successfully.
Additional context
CREATE CLUSTERED COLUMNSTORE INDEX produces a fatal error on SQLMesh: sqlmesh.utils.errors.ConfigError: Failed to parse a model definition.
When I tried to create a non-clustered columnstore index in the post-statement of SQLMesh Model, I got this warning from SQLGlot:
'@IF(@runtime_stage='evaluating', CREATE NONCLUSTERED COLUMNSTORE INDEX index_name ON foo.bar)' contains unsupported syntax. Falling back to parsing as a 'Command'. (parser.py:1474)
Although the command ran, it attempted to create the index on the final view in the destination schema foo but not the underlying table in sqlmesh__foo schema, which then failed the evaluation entirely. The macro @this_model unfortunately doesn't work on non-audit SQL models.
Is your feature request related to a problem? Please describe.
I'm trying to convert tables created by SQLMesh into columnar storage on MS SQL Server, but SQLGlot produces a ParseError on
CREATE CLUSTERED COLUMNSTORE INDEX index_name ON { database_name.schema_name.table_name | schema_name.table_name | table_name }
.Describe the solution you'd like
If SQLGlot can parse this command, it would help speed up downstream model evaluation in SQLMesh a lot, and save significant storage space (approximate compression ratio 10:1).
Describe alternatives you've considered
CREATE INDEX
for a normal rowstore index can be parsed successfully.Additional context
CREATE CLUSTERED COLUMNSTORE INDEX
produces a fatal error on SQLMesh:sqlmesh.utils.errors.ConfigError: Failed to parse a model definition
.When I tried to create a non-clustered columnstore index in the post-statement of SQLMesh Model, I got this warning from SQLGlot:
Although the command ran, it attempted to create the index on the final view in the destination schema
foo
but not the underlying table insqlmesh__foo
schema, which then failed the evaluation entirely. The macro@this_model
unfortunately doesn't work on non-audit SQL models.Thank you very much!