Comments (11)
One option: you can have
dbt-synapse
pull indbt-sqlserver
as a python dependency. That's the relationshipdbt-redshift
has withdbt-postgres
: it installs it as a dependency, and builds its own classes on top of the posgres ones (e.g.).That would enable you to avoid repeating boilerplate code around connections, for instance, between this repo and
dbt-sqlserver
. You'd only need to reimplement (= write code for) the things that are genuinely different on synapse.macros
Right now, both
dbt-sqlserver
anddbt-synapse
can usesqlserver__
implementations of common ("dispatched") macros because they both use an adapter type namedsqlserver
.Currently,
adapter.dispatch
doesn't include a notion of adapter dependencies, but it could: In that world,dbt-redshift
would first look for aredshift__
implementation, thenpostgres__
, thendefault__
. So, too, woulddbt-synapse
look first forsynapse__
, thensqlserver__
, thendefault__
.
This sounds like a great way of solving it. It would make it more transparent what the differences are as well.
from dbt-synapse.
This could be fixed with isolated envs, but I think that you should be able to use different adapaters separated using the project.yml
from dbt-synapse.
great point. It's definitely a use case we'd like to support wherein we could have a dev target be Azure SQL and a production target be Synapse. I've been meaning to rename the target officially to synapse
in our code with #6, but have been uncertain of what that means when we need to pull an update from the upstream dbt-sqlserver
will it:
- respect our rename, or
- will we have to do a merge commit where we rename the macro names every time back to
synapse
?
I guess we won't know until we try!
from dbt-synapse.
from dbt-synapse.
Yeah that's an option I think. Check out this dbt slack thread from a month ago where some options are discussed.
from dbt-synapse.
I guess it's fairly edge case for many users and easily solvable using venvs, so a nice to have feature change really.
from dbt-synapse.
Going to do some experiments this week on this.
from dbt-synapse.
One option: you can have dbt-synapse
pull in dbt-sqlserver
as a python dependency. That's the relationship dbt-redshift
has with dbt-postgres
: it installs it as a dependency, and builds its own classes on top of the posgres ones (e.g.).
That would enable you to avoid repeating boilerplate code around connections, for instance, between this repo and dbt-sqlserver
. You'd only need to reimplement (= write code for) the things that are genuinely different on synapse.
macros
Right now, both dbt-sqlserver
and dbt-synapse
can use sqlserver__
implementations of common ("dispatched") macros because they both use an adapter type named sqlserver
.
Currently, adapter.dispatch
doesn't include a notion of adapter dependencies, but it could: In that world, dbt-redshift
would first look for a redshift__
implementation, then postgres__
, then default__
. So, too, would dbt-synapse
look first for synapse__
, then sqlserver__
, then default__
.
from dbt-synapse.
@jtcohen6 this is definitely something I've been wanting to discuss. Take a look at dbt-msft/dbt-sqlserver#32. Looking at just the the .sql
macro files you can see there's very little difference between the packages. We'd love the help making streamlining them.
Another possible alternative is to have a single adapter, dbt-tsql
that supports SQL Server, Azure SQL, and Azure Synapse Analytics. My thinking here would be to use the EngineEdition
property via T-SQL's SERVERPROPERTY()
where:
Id | Product |
---|---|
1-4,8 |
SQL Server |
5,8,9 |
Azure SQL |
6 |
Azure Synapse |
The high level differences are:
- SQL Server
- has a 20 years of legacy, but
- some functions like
DROP ... IF EXISTS
weren't introduced until 2016
- Azure SQL
- has the vast majority of still-relevant SQL Server functionality
- (to the extent that
dbt-sqlserver
works perfectly with Azure SQL especially with recent PRs that add cloud features like Azure Active Directory and External Tables
- Azure Synapse:
- promotes a new pattern of creating tables,
CTAS
that allows specification of indices and distribution - is still re-writing T-SQL to be parallel by default so doesn't have all the T-SQL functions of Azure SQL (e.g.
MERGE
and Table-Valued Functions are now in preview as of October 2020)
- promotes a new pattern of creating tables,
from the SERVERPROPERTY()
doc
Id | EngineEdition |
---|---|
1 | Personal or Desktop Engine (Not available in SQL Server 2005 (9.x) and later versions.) |
2 | Standard (This is returned for Standard, Web, and Business Intelligence.) |
3 | Enterprise (This is returned for Evaluation, Developer, and Enterprise editions.) |
4 | Express (This is returned for Express, Express with Tools, and Express with Advanced Services) |
5 | SQL Database |
6 | Microsoft Azure Synapse Analytics (formerly SQL Data Warehouse) |
8 | Azure SQL Managed Instance |
9 | Azure SQL Edge (This is returned for all editions of Azure SQL Edge) |
cc: @NandanHegde15 @alieus @mikaelene
from dbt-synapse.
getting very close to this with #32!
from dbt-synapse.
resolved!
from dbt-synapse.
Related Issues (20)
- upgrade to support dbt-core v1.2.0 HOT 1
- upgrade to support dbt-core v1.2.0
- upgrade to support dbt-core v1.2.0
- upgrade to support dbt-core v1.2.0
- Error when using incremental models on Synapse REPLICATE table distribution HOT 4
- Incorrect syntax near 'column' error adding a New Column with on_schema_change='sync_all_columns' HOT 1
- Incorrect syntax near 'column' error renaming a Column with on_schema_change='sync_all_columns' HOT 1
- upgrade to support dbt-core v1.3.0 HOT 1
- sam, are you there?
- sam, are you there?
- Changing the distribution and index types in existing snapshots don't have any effect HOT 1
- upgrade to support dbt-core v1.4.0 HOT 2
- Stand up new CI-testing pool HOT 1
- upgrade to support dbt-core v1.5.0
- This repo is missing important files
- upgrade to support dbt-core v1.6.0
- Incremental table creation has unneccessary indexes, write temp table as a HEAP HOT 1
- Satellite problem when using case sensitive collations HOT 1
- upgrade to support dbt-core v1.7.0
- create_nonclustered_index macro ends up in endless recursion HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dbt-synapse.