dbt-labs / dbt-spark

dbt-spark contains all of the code enabling dbt to work with Apache Spark and Databricks
https://getdbt.com
Apache License 2.0
405 stars 227 forks source link

[ADAP-364] [Spark] Generate order-agnostic constraints ddl when contract: true #671

Closed MichelleArk closed 1 year ago

MichelleArk commented 1 year ago

Core issue: https://github.com/dbt-labs/dbt-core/issues/7064

Wrap create_table_as user sql in schema-ordered select statement for models with contract: true

Wrap create_table_as user sql in schema-ordered select statement for models with contract: true Could look like: a call to default__get_select_subquery implemented in dbt-core, called in spark__create_table_as

We won't need to do this for view materializations as they don't support constraints.