Sigma view definition error

Suddenly my dashboard widgets are displaying the following error:

Warehouse Error: Query Failed
SQL compilation error: View definition for ‘DB.SCHEMA.USER_HISTORY’ declared 43 column(s), but view query produces 47 column(s).

Does anyone know the meaning of this?

Looks like your Sigma Dashboard is referencing a view in your warehouse (DB.SCHEMA.USER_HISTORY) whose definition is no longer valid; when your view was initially created, it had 43 columns, but now it has 47 columns. This might happen if your view definition includes a “select * from SOME.TABLE.FOO”, and columns were added to the definition of the table SOME.TABLE.FOO.

1 Like

So the solution here is to recompile (ie REPLACE VIEW ) the underlying view. If that view sits on top of another view, recompile that other view as well.

More on that here in the “Notes” section here: https://docs.snowflake.com/en/sql-reference/sql/create-view.html

1 Like