diff --git a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/catalog/ExternalCatalog.scala b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/catalog/ExternalCatalog.scala index bb3b1a78d9d44..a71e9634fb2b8 100644 --- a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/catalog/ExternalCatalog.scala +++ b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/catalog/ExternalCatalog.scala @@ -88,13 +88,10 @@ trait ExternalCatalog { def setCurrentDatabase(db: String): Unit - /** KAP#16210 */ def listRoleUsers(roleName: String): Seq[String] - /** KAP#16210 */ def listUserRoles(userName: String): Seq[String] - /** KAP#16210 */ def getReadablePrincipals(dbName: String, tableName: String): Map[String, Seq[String]] // -------------------------------------------------------------------------- diff --git a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/catalog/ExternalCatalogWithListener.scala b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/catalog/ExternalCatalogWithListener.scala index 09bf04cb6c913..691439a99e5ec 100644 --- a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/catalog/ExternalCatalogWithListener.scala +++ b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/catalog/ExternalCatalogWithListener.scala @@ -81,17 +81,14 @@ class ExternalCatalogWithListener(delegate: ExternalCatalog) delegate.setCurrentDatabase(db) } - /** KAP#16210 */ override def listRoleUsers(roleName: String): Seq[String] = { delegate.listRoleUsers(roleName) } - /** KAP#16210 */ override def listUserRoles(userName: String): Seq[String] = { delegate.listUserRoles(userName) } - /** KAP#16210 */ override def getReadablePrincipals(dbName: String, tableName: String): Map[String, Seq[String]] = { delegate.getReadablePrincipals(dbName, tableName) diff --git a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/catalog/InMemoryCatalog.scala b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/catalog/InMemoryCatalog.scala index 1b4041fb3af96..e1fe5d59d8119 100644 --- a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/catalog/InMemoryCatalog.scala +++ b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/catalog/InMemoryCatalog.scala @@ -176,17 +176,14 @@ class InMemoryCatalog( override def setCurrentDatabase(db: String): Unit = { /* no-op */ } - /** KAP#16210 */ override def listRoleUsers(roleName: String): Seq[String] = { Seq.empty; } - /** KAP#16210 */ override def listUserRoles(userName: String): Seq[String] = { Seq.empty } - /** KAP#16210 */ override def getReadablePrincipals(dbName: String, tableName: String): Map[String, Seq[String]] = { Map.empty diff --git a/sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveExternalCatalog.scala b/sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveExternalCatalog.scala index 9687ae4ea903c..62c2d488c7b88 100644 --- a/sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveExternalCatalog.scala +++ b/sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveExternalCatalog.scala @@ -227,17 +227,14 @@ private[spark] class HiveExternalCatalog(conf: SparkConf, hadoopConf: Configurat client.setCurrentDatabase(db) } - /** KAP#16210 */ override def listRoleUsers(roleName: String): Seq[String] = withClient { client.listRoleUsers(roleName) } - /** KAP#16210 */ override def listUserRoles(userName: String): Seq[String] = withClient { client.listUserRoles(userName) } - /** KAP#16210 */ override def getReadablePrincipals(dbName: String, tableName: String): Map[String, Seq[String]] = withClient { client.getReadablePrincipals(dbName, tableName) diff --git a/sql/hive/src/main/scala/org/apache/spark/sql/hive/client/HiveClient.scala b/sql/hive/src/main/scala/org/apache/spark/sql/hive/client/HiveClient.scala index 33045f64a51bb..6794af25c6ed3 100644 --- a/sql/hive/src/main/scala/org/apache/spark/sql/hive/client/HiveClient.scala +++ b/sql/hive/src/main/scala/org/apache/spark/sql/hive/client/HiveClient.scala @@ -289,13 +289,10 @@ private[hive] trait HiveClient { /** Used for testing only. Removes all metadata from this instance of Hive. */ def reset(): Unit - /** KAP#16210 */ def listRoleUsers(roleName: String): Seq[String] - /** KAP#16210 */ def listUserRoles(userName: String): Seq[String] - /** KAP#16210 */ def getReadablePrincipals(dbName: String, tableName: String): Map[String, Seq[String]] } diff --git a/sql/hive/src/main/scala/org/apache/spark/sql/hive/client/HiveClientImpl.scala b/sql/hive/src/main/scala/org/apache/spark/sql/hive/client/HiveClientImpl.scala index 46fbe52493308..4e14250f9d351 100644 --- a/sql/hive/src/main/scala/org/apache/spark/sql/hive/client/HiveClientImpl.scala +++ b/sql/hive/src/main/scala/org/apache/spark/sql/hive/client/HiveClientImpl.scala @@ -687,7 +687,6 @@ private[hive] class HiveClientImpl( client.getTablesByPattern(dbName, pattern).asScala } - /** KAP#16210 */ override def listRoleUsers(roleName: String): Seq[String] = withHiveState { val resp = client.getMSC.get_principals_in_role(new GetPrincipalsInRoleRequest(roleName)) if (resp == null || resp.getPrincipalGrants == null) { @@ -699,7 +698,6 @@ private[hive] class HiveClientImpl( .map(_.getPrincipalName) } - /** KAP#16210 */ override def listUserRoles(userName: String): Seq[String] = withHiveState { val resp = client.getMSC.list_roles(userName, PrincipalType.USER) if (resp == null) { @@ -708,7 +706,6 @@ private[hive] class HiveClientImpl( resp.asScala.map(_.getRoleName) } - /** KAP#16210 */ override def getReadablePrincipals(dbName: String, tableName: String): Map[String, Seq[String]] = withHiveState { val privileges = client.getMSC.list_privileges(null, null,