Schema configuration in DBAB causes recreate everytime
Describe the issue
When defining a schema in an asset bundle, the schema gets recreated everytime.
I poked around a little bit and firstly I found:
force_destroy: true in bundle.tf.json.
Then I looked a bit at the source code, and I noticed this: https://github.com/databricks/cli/blob/4550b4993dd15b5ccae0a0359133c39b919b6b57/bundle/deploy/terraform/tfdyn/convert_schema.go#L23
This will make it so the schema gets recreated every time. This is might be problematic if there are other resources depending on the same schema, especially if they're of type MANAGED and not EXTERNAL.
Configuration
resources:
schemas:
configs:
name: demo_schema
catalog_name: demo_catalog
comment: This schema was created by Databricks Asset Bundles and it represents a demo placeholder.
storage_root: ...
Steps to reproduce the behavior
- Use the configuration defined
- Run
databricks bundle deploy ...for the first time - Run
databricks bundle deploy ...for the second time, - See error:
The following UC schemas will be deleted or recreated. Any underlying data may be lost:
recreate schema demo_schema
+1, I also have this issue.
This issue has not received a response in a while. If you want to keep this issue open, please leave a comment below and auto-close will be canceled.