databricks / dbt-databricks

A dbt adapter for Databricks.
https://databricks.com
Apache License 2.0
226 stars 119 forks source link

Behavior: Get column info from information_schema Part I #808

Closed benc-db closed 1 month ago

benc-db commented 1 month ago

Partial fix for #779

Description

This is my second attempt at addressing the issue that describe extended can truncate complex types. With the release of dbt-core 1.8.7, we can now process behavior flags; this PR introduces the choice of using information_schema for grabbing column information in get_columns_for_relation. I'm hiding behind a behavior flag because given the current state of UC information_schema, we have to run repair to trust that columns of recently created or altered table will be present in the information_schema, which adds overhead. Furthermore, this trick only works for Delta tables at this time. It is hoped that in time the sync issue with information_schema will be solved, but in the mean time, users can use this flag when they have complex types that describe extended truncates.

Checklist