dbt-databricks icon indicating copy to clipboard operation
dbt-databricks copied to clipboard

Help with an example of the materialization type `clone`

Open johnson-jay-l opened this issue 1 year ago • 7 comments
trafficstars

Describe the bug

I would like to try using the materialization type of clone so that I can have a model that "publishes" tested data runs downstream from the actual model being tested. The clone should have the same table name as the upstream model but should be in a different database schema.

This materialization type is not documented and I can't figure out how to get it to work for my use case.

Code for the clone materialization: https://github.com/databricks/dbt-databricks/blob/main/dbt/include/databricks/macros/materializations/clone.sql

Steps To Reproduce

  • Need an example of how to create a model with the clone materialization type

Expected behavior

  • Docs are updated
  • Able to create a table in databricks via shallow clone, that is cloned from an upstream model

Screenshots and log output

n/a

System information

The output of dbt --version:

dbt@06f0d6eceaea:~$ dbt --version
Core:
  - installed: 1.8.6

  The latest version of dbt-core could not be determined!
  Make sure that the following URL is accessible:
  https://pypi.org/pypi/dbt-core/json

Plugins:
  - redshift:   1.8.1 - Up to date!
  - databricks: 1.8.5 - Update available!
  - spark:      1.8.0 - Up to date!
  - postgres:   1.8.2 - Up to date!

  At least one plugin is out of date or incompatible with dbt-core.
  You can find instructions for upgrading here:
  https://docs.getdbt.com/docs/installation

The operating system you're using:

The output of python --version:

dbt@06f0d6eceaea:~$ python --version
Python 3.9.20

Additional context

  • I am willing to raise a documentation PR if someone can help me out with an example

johnson-jay-l avatar Oct 21 '24 04:10 johnson-jay-l