sqlmesh
sqlmesh copied to clipboard
MSSQL: Order change in model columns definition crashed model plan
Version used: 0.159.0 Engine: MSSQL
Example:
@model(
columns={'chgdat': 'varchar(max)',
'chgusr': 'varchar(max)',
'compny': 'varchar(max)',
'credat': 'varchar(max)',
'creusr': 'varchar(max)',
'digcod': 'varchar(max)',
'dignam': 'varchar(max)',
'migcod': 'varchar(max)',
'sigcod': 'varchar(max)',
'srtnam': 'varchar(max)',
'srtnum': 'varchar(max)',
'txtdsc': 'varchar(max)',
'data_modified': 'date',
'source_catalog': 'varchar(max)'
}
In this model definition, the order is
- data_modified
- source_catalog
In my query it was:
- source_catalog
- data_modified
This results in MSSQLDatabaseException: (0, b'Unknown Error)
Having the same order makes the query run just fine.
I guess that the query informs how the dataframe is created, im just thinking sqlmesh should be able to pair the key values anyway, regardless of the order.
@treysp can you please have a look
This is fixed as of v0.182.0