Comments (2)
@swanderz the example that it should be is identical unless my eyes deceive me. What you meant was, the statement should be:
alter table <db>.<schema>.<table> add <name> <datatype>;
I think?
Extra notes from slack:
I just checked and there’s no alter_relation_add_remove_columns macro for dbt-synapse or dbt-sqlserver! Maybe the default add_column
works for SQL Server but not for Synapse?
We’d add a sqlserver__alter_relation_add_remove_columns
or synapse__alter_relation_add_remove_columns macro
. You mind making a pull request? It’ll land in one of the adapters.sql and this what the default macro looks like that you can use as a template.
{% macro default__alter_relation_add_remove_columns(relation, add_columns, remove_columns) %}
{% if add_columns is none %}
{% set add_columns = [] %}
{% endif %}
{% if remove_columns is none %}
{% set remove_columns = [] %}
{% endif %}
{% set sql -%}
alter {{ relation.type }} {{ relation }}
{% for column in add_columns %}
add column {{ column.name }} {{ column.data_type }}{{ ',' if not loop.last }}
{% endfor %}{{ ',' if remove_columns | length > 0 }}
{% for column in remove_columns %}
drop column {{ column.name }}{{ ',' if not loop.last }}
{% endfor %}
{%- endset -%}
{% do run_query(sql) %}
{% endmacro %}
from dbt-synapse.
closing -- please comment if you think this bug still persists!
from dbt-synapse.
Related Issues (20)
- 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
- Unable to authenticate to a synapse intance with a dedicated pool HOT 7
- Version of adapter is not visible for `dbt --version` command HOT 2
- upgrade to support dbt-core v1.8.0
- `get_limit_subquery()` does not work with queries containing CTEs HOT 1
- Synapse sql login not working HOT 3
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.