databricks / dbt-databricks

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

Sync metadata before asking for column definitions #799

Closed benc-db closed 2 months ago

benc-db commented 2 months ago

Description

After switching to using information_schema where possible to get column types to address the issue of describe truncation them, I discovered that information_schema is off out of sync when this call is made. I discovered this by running an incremental job twice. On the second run, the columns for some tables from the first run were available in information_schema. This PR forces metadata sync before getting column information to ensure the information_schema is up to date. We should probably use this technique more pervasively, but I do want to hold off on that until we have behavior flags, since it could have a performance impact.

Also, commenting out behavior flags for now, because support doesn't exist yet in dbt-core 1.8

Checklist