MSCK REPAIR PRIVILEGES

Applies to: check marked yes Databricks SQL check marked yes Databricks Runtime

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 or Databricks Runtime.

Syntax

MSCK REPAIR object PRIVILEGES

object
  { [ SCHEMA | DATABASE ] schema_name |
    FUNCTION function_name |
    TABLE table_name
    VIEW view_name |
    ANONYMOUS FUNCTION |
    ANY FILE }

Parameters

  • schema_name

    Names the schema 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 SCHEMA gone_from_hive PRIVILEGES;

> MSCK REPAIR ANONYMOUS FUNCTION PRIVILEGES;

> MSCK REPAIR TABLE default.dropped PRIVILEGES;