databricks / dbt-databricks

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

Fix for describe column types #796

Closed benc-db closed 2 months ago

benc-db commented 2 months ago

Resolves #779 (for UC)

Description

DESCRIBE EXTENDED truncates column types. For generating doc site, this is ok, but for running a dbt project, it can cause issues. Where information_schema is available, we can use it to get an un-truncated column type. Initially I was going to hide this behind a behavior flag, since both methods can have performance issues; however, during implementation I discovered that behavior flags aren't available to adapters yet, due to the current dbt-core not having flags on the RuntimeConfig object. So, plan is to use information_schema where available, as it is more correct. Once behavior flags are available, we can allow users to choose, so that if one way is less performant, they can switch.

Checklist