Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MSSQL: Order change in model columns definition crashed model plan #3915

Open
ebremst3dt opened this issue Feb 27, 2025 · 1 comment
Open
Assignees
Labels
Bug Something isn't working Engine: SQL Server

Comments

@ebremst3dt
Copy link

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

  1. data_modified
  2. source_catalog

In my query it was:

  1. source_catalog
  2. 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.

@izeigerman izeigerman added Bug Something isn't working Engine: SQL Server labels Mar 11, 2025
@izeigerman
Copy link
Member

@treysp can you please have a look

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working Engine: SQL Server
Projects
None yet
Development

No branches or pull requests

3 participants