You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
dbt-fabric has implemented a render_limited() class method that should work for Synapse as well
@classmethod# from https://github.com/microsoft/dbt-fabric/blob/525fe95c960beb3c8dc0b34130111d6284aa3eab/dbt/adapters/fabric/fabric_relation.py#L20defrender_limited(self) ->str:
rendered=self.render()
ifself.limitisNone:
returnrenderedelifself.limit==0:
returnf"(select * from {rendered} where 1=0) {self._render_limited_alias()}"else:
returnf"(select TOP {self.limit} * from {rendered}) {self._render_limited_alias()}"
The text was updated successfully, but these errors were encountered:
Issue Summary
dbt build model_name --empty
executesselect * from schema.model_name where false limit 0
statements.These aren't valid in Synapse/T-SQL and return
Incorrect syntax near 'limit'.
errors.Versions
dbt-core v1.8.9
dbt-synapse v1.8.1
Cause
SynapseRelation
extendsBaseRelation
but doesn't override the default adapter'srender_limited()
class method, causing the above behaviour.dbt-synapse/dbt/adapters/synapse/synapse_relation.py
Lines 10 to 11 in beedf08
Possible fix
dbt-fabric has implemented a
render_limited()
class method that should work for Synapse as wellThe text was updated successfully, but these errors were encountered: