MSCK REPAIR PRIVILEGES (Databricks SQL)

Removes all the privileges from all the users associated with the object.

You use this statement to clean up residual access control left behind after objects have been dropped from the Hive metastore outside of Databricks SQL.

Syntax

MSCK REPAIR object PRIVILEGES

object
  { DATABASE database_name |
    FUNCTION function_name |
    TABLE table_name
    VIEW view_name |
    ANONYMOUS FUNCTION |
    ANY FILE }

Parameters

  • database_name

    Names the database from which privileges are removed.

  • function_name

    Names the function from which privileges are removed.

  • table_name

    Names the table from which privileges are removed.

  • view_name

    Names the view from which privileges are removed.

  • ANY FILE

    Revokes ANY FILE privilege from all users.

  • ANONYMOUS FUNCTION

    Revokes ANONYMOUS FUNCTION privilege from all users.

Examples

> MSCK REPAIR DATABASE gone_from_hive PRIVILEGES;

> MSCK REPAIR ANONYMOUS FUNCTION PRIVILEGES;

> MSCK REPAIR TABLE default.dropped PRIVILEGES;