synapse__get_limit_subquery() wraps provided SQL string (sql) into a Subquery. If the subquery has a CTE, the SQL output by synapse__get_limit_subquery will throw the below error because CTEs are not supported within subqueries
('42000', "[42000] [Microsoft]
[ODBC Driver 18 for SQL Server][SQL Server]
Parse error at line: 9, column: 5:
Incorrect syntax near 'ID'. (103010) (SQLExecDirectW)")
This is especially a problem with the dbt Cloud IDE which will, by default, always try to only fetch the first 500 rows when previewing and compiling models.
synapse__get_limit_subquery()
wraps provided SQL string (sql
) into a Subquery. If the subquery has a CTE, the SQL output bysynapse__get_limit_subquery
will throw the below error because CTEs are not supported within subqueriesThis is especially a problem with the dbt Cloud IDE which will, by default, always try to only fetch the first 500 rows when previewing and compiling models.
I thought at first that
fabric__get_limit_subquery()
would work, butOFFSET
is not supported in Synapse.code in question
https://github.com/microsoft/dbt-synapse/blob/7d414cd122c91d3b45dd4e158afd82152c9695ff/dbt/include/synapse/macros/adapters/show.sql#L16-L22