AngersZhuuuu commented on a change in pull request #34388:
URL: https://github.com/apache/spark/pull/34388#discussion_r736520113



##########
File path: 
sql/hive/src/main/scala/org/apache/spark/sql/hive/client/HiveShim.scala
##########
@@ -484,6 +549,111 @@ private[client] class Shim_v0_12 extends Shim with 
Logging {
   override def getDatabaseOwnerName(db: Database): String = ""
 
   override def setDatabaseOwnerName(db: Database, owner: String): Unit = {}
+
+  override def createDatabase(hive: Hive, db: Database, ignoreIfExists: 
Boolean): Unit = {
+    hive.createDatabase(db, ignoreIfExists)
+  }
+
+  override def dropDatabase(
+      hive: Hive,
+      name: String,
+      deleteData: Boolean,
+      ignoreUnknownDb: Boolean,
+      cascade: Boolean): Unit = {
+    hive.dropDatabase(name, deleteData, ignoreUnknownDb, cascade)
+  }
+
+  override def alterDatabase(hive: Hive, dbName: String, d: Database): Unit = {
+    hive.alterDatabase(dbName, d)
+  }
+
+  override def getDatabase(hive: Hive, dbName: String): Database = {
+    hive.getDatabase(dbName)
+  }
+
+  override def getAllDatabases(hive: Hive): JList[String] = {
+    hive.getAllDatabases
+  }
+
+  override def getDatabasesByPattern(hive: Hive, pattern: String): 
JList[String] = {
+    hive.getDatabasesByPattern(pattern)
+  }
+
+  override def databaseExists(hive: Hive, dbName: String): Boolean = {
+    hive.databaseExists(dbName)
+  }
+
+  override def createTable(hive: Hive, table: Table, ifNotExists: Boolean): 
Unit = {
+    hive.createTable(table, ifNotExists)
+  }
+
+  override def getTable(
+      hive: Hive,
+      dbName: String,
+      tableName: String,
+      throwException: Boolean): Table = {
+    hive.getTable(dbName, tableName, throwException)
+  }
+
+  override def getTablesByPattern(hive: Hive, dbName: String, pattern: 
String): JList[String] = {
+    hive.getTablesByPattern(dbName, pattern)
+  }
+
+  override def getAllTables(hive: Hive, dbName: String): JList[String] = {
+   hive.getAllTables(dbName)

Review comment:
       Done

##########
File path: 
sql/hive/src/main/scala/org/apache/spark/sql/hive/client/HiveShim.scala
##########
@@ -97,12 +116,50 @@ private[client] sealed abstract class Shim {
 
   def alterPartitions(hive: Hive, tableName: String, newParts: 
JList[Partition]): Unit
 
+  def createTable(hive: Hive, table: Table, ifNotExists: Boolean): Unit
+
+  def getTable(
+      hive: Hive,
+      dbName: String,
+      tableName: String,
+      throwException: Boolean = true): Table
+
   def getTablesByType(
       hive: Hive,
       dbName: String,
       pattern: String,
       tableType: TableType): Seq[String]
 
+  def getTablesByPattern(hive: Hive, dbName: String, pattern: String): 
JList[String]
+
+  def getAllTables(hive: Hive, dbName: String): JList[String]
+
+  def dropTable(hive: Hive, dbName: String, tableName: String): Unit
+
+  def getPartition(
+      hive: Hive,
+      table: Table,
+      partSpec: JMap[String, String],
+      forceCreate: Boolean): Partition
+
+  def getPartitions(
+      hive: Hive,
+      table: Table,
+      partSpec: JMap[String, String]): JList[Partition]
+
+  def getPartitionNames(
+    hive: Hive,
+    dbName: String,
+    tblName: String,
+    max: Short): JList[String]

Review comment:
       Done




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to