Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/databricks/labs/ucx/hive_metastore/mapping.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ def skip_table_or_view(self, schema_name: str, table_name: str, load_table: Call
if table is None:
raise NotFound("[TABLE_OR_VIEW_NOT_FOUND]")
self._sql_backend.execute(
f"ALTER {table.kind} {escape_sql_identifier(schema_name)}.{escape_sql_identifier(table_name)} SET TBLPROPERTIES('{self.UCX_SKIP_PROPERTY}' = true)"
f"ALTER {table.kind} {escape_sql_identifier(table.full_name)} SET TBLPROPERTIES('{self.UCX_SKIP_PROPERTY}' = true)"
)
except NotFound as err:
if "[TABLE_OR_VIEW_NOT_FOUND]" in str(err) or "[DELTA_TABLE_NOT_FOUND]" in str(err):
Expand Down
6 changes: 3 additions & 3 deletions tests/unit/hive_metastore/test_mapping.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,15 +208,15 @@ def test_skip_happy_path(caplog):
mapping.skip_table_or_view(schema_name="schema", table_name="table", load_table=lambda _schema, _table: table)
ws.tables.get.assert_not_called()
sbe.execute.assert_called_with(
f"ALTER TABLE `schema`.`table` SET TBLPROPERTIES('{mapping.UCX_SKIP_PROPERTY}' = true)"
f"ALTER TABLE `catalog`.`schema`.`table` SET TBLPROPERTIES('{mapping.UCX_SKIP_PROPERTY}' = true)"
)
view = Table(
catalog="catalog", database="schema", name="table", object_type="table", table_format="csv", view_text="stuff"
catalog="catalog", database="schema", name="view", object_type="table", table_format="csv", view_text="stuff"
)
mapping.skip_table_or_view(schema_name="schema", table_name="view", load_table=lambda _schema, _table: view)
ws.tables.get.assert_not_called()
sbe.execute.assert_called_with(
f"ALTER VIEW `schema`.`view` SET TBLPROPERTIES('{mapping.UCX_SKIP_PROPERTY}' = true)"
f"ALTER VIEW `catalog`.`schema`.`view` SET TBLPROPERTIES('{mapping.UCX_SKIP_PROPERTY}' = true)"
)
assert len(caplog.records) == 0
mapping.skip_schema(schema="schema")
Expand Down