beliefer commented on a change in pull request #30870:
URL: https://github.com/apache/spark/pull/30870#discussion_r547810223



##########
File path: 
sql/catalyst/src/main/scala/org/apache/spark/sql/QueryExecutionErrors.scala
##########
@@ -56,4 +63,64 @@ object QueryExecutionErrors {
   def cannotTerminateGeneratorError(generator: UnresolvedGenerator): Throwable 
= {
     new UnsupportedOperationException(s"Cannot terminate expression: 
$generator")
   }
+
+  def unableCreateDatabaseAsFailedCreateDirectoryError(
+      dbDefinition: CatalogDatabase, e: IOException): Throwable = {
+    new SparkException(s"Unable to create database ${dbDefinition.name} as 
failed " +
+      s"to create its directory ${dbDefinition.locationUri}", e)
+  }
+
+  def unableDropDatabaseAsFailedDeleteDirectoryError(
+      dbDefinition: CatalogDatabase, e: IOException): Throwable = {
+    new SparkException(s"Unable to drop database ${dbDefinition.name} as 
failed " +
+      s"to delete its directory ${dbDefinition.locationUri}", e)
+  }
+
+  def unableCreateTableAsFailedCreateDirectoryError(
+      table: String, defaultTableLocation: Path, e: IOException): Throwable = {
+    new SparkException(s"Unable to create table $table as failed " +
+      s"to create its directory $defaultTableLocation", e)
+  }
+
+  def unableDeletePartitionPathError(partitionPath: Path, e: IOException): 
Throwable = {
+    new SparkException(s"Unable to delete partition path $partitionPath", e)
+  }
+
+  def unableDropTableAsFailedDeleteDirectoryError(
+      table: String, dir: Path, e: IOException): Throwable = {
+    new SparkException(s"Unable to drop table $table as failed " +
+      s"to delete its directory $dir", e)
+  }
+
+  def unableRenameTableAsFailedRenameDirectoryError(
+      oldName: String, newName: String, oldDir: Path, e: IOException): 
Throwable = {
+    new SparkException(s"Unable to rename table $oldName to $newName as failed 
" +
+      s"to rename its directory $oldDir", e)
+  }
+
+  def unableCreatePartitionPathError(partitionPath: Path, e: IOException): 
Throwable = {
+    new SparkException(s"Unable to create partition path $partitionPath", e)
+  }
+
+  def unableRenamePartitionPathError(oldPartPath: Path, e: IOException): 
Throwable = {
+    new SparkException(s"Unable to rename partition path $oldPartPath", e)
+  }
+
+  def methodNotImplementedError(methodName: String): Throwable = {
+    new UnsupportedOperationException(s"$methodName is not implemented")
+  }
+
+  def cannotReadCorruptedTablePropertyError(key: String): Throwable = {

Review comment:
       Good idea.




----------------------------------------------------------------
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.

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