-
Notifications
You must be signed in to change notification settings - Fork 231
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[CT-1842] [Feature] Support on_schema_change='sync_all_columns'
for Delta tables
#594
Comments
on_schema_change='sync_all_columns'
for Delta tableson_schema_change='sync_all_columns'
for Delta tables
Good find! I was just converting these tests (#593), and remembering the hard way that Delta doesn't (by default) support removing columns. I'll queue up for discussion with the relevant team. Depending on other commitments, we may want to mark this one as |
This issue has been marked as Stale because it has been open for 180 days with no activity. If you would like the issue to remain open, please remove the stale label or comment on the issue, or it will be closed in 7 days. |
still relevant for us |
This issue has been marked as Stale because it has been open for 180 days with no activity. If you would like the issue to remain open, please comment on the issue or else it will be closed in 7 days. |
still relevant for us |
Is this your first time submitting a feature request?
Describe the feature
Delta Lake 2.0 supports dropping of columns on delta tables if the table has certain
tblproperties
(https://delta.io/blog/2022-08-29-delta-lake-drop-column/) so we may want to support theon_schema_change = 'sync_all_columns'
config when columns are removed from the source (compared to the target).Describe alternatives you've considered
A user could probably achieve this today by rewriting some of the relevant built-in macros.
Who will this benefit?
Previously a schema change (specifically a column removed from source vs target) will result in an exception:
dbt-spark/dbt/include/spark/macros/adapters.sql
Line 280 in 5ca20be
Primarily this will bring it up to par with other adapters's behaviour for
on_schema_change
without having users to implement their own overrides for the relevant helper macros (e.g.alter_relation_add_remove_columns()
and family).Are you interested in contributing this feature?
Sure
Anything else?
We did not support this behaviour back in #229 because delta could not drop columns - this is now supported (albeit with the necessary tblproperties applied).
Probably the way to do this is to retrieve the tblproperties of the target - and then decide whether to raise or not (or perhaps warn with a suggestion "in order to drop columns, please alter the tblproperties, ...".
We probably want this in dbt-databricks too. The behaviour in the adapter is the same as it is here.
The text was updated successfully, but these errors were encountered: