Fix insertion macro for Databricks Unity Catalog #252
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR fixes an issue for Databricks projects with Unity Catalog enabled.
Currently, the
insert_into_metadata_table
macro only specifies theschema_name.table_name
, but with catalogs (databases) introduced in Unity Catalog, thedatabase_name
is also required or the insertion fails.This should be backwards compatible with non-UC implementations of databricks since they can now also be fully qualified with a
database_name
ofhive_metastore
- assuming this value gets populated automatically, of course.If there are any issues with non-UC implementations of databricks, or spark since it also shares this macro, an alternate solution would be to first check that the
database_name
has a value, and if so use it, otherwise just keepschema_name.table_name