allisonwang-db commented on a change in pull request #32763:
URL: https://github.com/apache/spark/pull/32763#discussion_r645916521



##########
File path: 
sql/catalyst/src/main/scala/org/apache/spark/sql/errors/QueryCompilationErrors.scala
##########
@@ -1605,4 +1605,21 @@ private[spark] object QueryCompilationErrors {
       tableIdentifier: TableIdentifier): Throwable = {
     new AnalysisException(s"$tableIdentifier should be converted to 
HadoopFsRelation.")
   }
+
+  def alterDatabaseLocationUnsupportedError(version: String): Throwable = {
+    new AnalysisException(s"Hive $version does not support altering database 
location")
+  }
+
+  def hiveTableTypeNotSupportedError(tableType: String): Throwable = {

Review comment:
       hiveTableTypeUnsupportedError

##########
File path: 
sql/catalyst/src/main/scala/org/apache/spark/sql/errors/QueryCompilationErrors.scala
##########
@@ -1605,4 +1605,21 @@ private[spark] object QueryCompilationErrors {
       tableIdentifier: TableIdentifier): Throwable = {
     new AnalysisException(s"$tableIdentifier should be converted to 
HadoopFsRelation.")
   }
+
+  def alterDatabaseLocationUnsupportedError(version: String): Throwable = {
+    new AnalysisException(s"Hive $version does not support altering database 
location")
+  }
+
+  def hiveTableTypeNotSupportedError(tableType: String): Throwable = {
+    new AnalysisException(s"Hive $tableType is not supported.")
+  }
+
+  def hiveNotSupportCreatePermanentFunctionsError(): Throwable = {

Review comment:
       hiveCreatePermanentFunctionsUnsupportedError

##########
File path: 
sql/catalyst/src/main/scala/org/apache/spark/sql/errors/QueryExecutionErrors.scala
##########
@@ -1256,4 +1258,67 @@ object QueryExecutionErrors {
   def cannotCreateStagingDirError(message: String, e: IOException): Throwable 
= {
     new RuntimeException(s"Cannot create staging directory: $message", e)
   }
+
+  def serDeInterfaceNotFoundError(e: NoClassDefFoundError): Throwable = {
+    new ClassNotFoundException("The SerDe interface removed since Hive 
2.3(HIVE-15167)." +
+      " Please migrate your custom SerDes to Hive 2.3. See HIVE-15167 for more 
details.", e)
+  }
+
+  def convertHiveTableToCatalogTableError(
+      e: SparkException, dbName: String, tableName: String): Throwable = {
+    new SparkException(s"${e.getMessage}, db: $dbName, table: $tableName", e)
+  }
+
+  def cannotRecognizeHiveTypeError(
+      e: ParseException, fieldType: String, fieldName: String): Throwable = {
+    new SparkException(
+      s"Cannot recognize hive type string: $fieldType, column: $fieldName", e)
+  }
+
+  def getTablesByTypeUnsupportedByLowerVersionHiveError(): Throwable = {

Review comment:
       getTablesByTypeUnsupportedByHiveVersionError

##########
File path: 
sql/catalyst/src/main/scala/org/apache/spark/sql/errors/QueryExecutionErrors.scala
##########
@@ -1256,4 +1258,67 @@ object QueryExecutionErrors {
   def cannotCreateStagingDirError(message: String, e: IOException): Throwable 
= {
     new RuntimeException(s"Cannot create staging directory: $message", e)
   }
+
+  def serDeInterfaceNotFoundError(e: NoClassDefFoundError): Throwable = {
+    new ClassNotFoundException("The SerDe interface removed since Hive 
2.3(HIVE-15167)." +
+      " Please migrate your custom SerDes to Hive 2.3. See HIVE-15167 for more 
details.", e)
+  }
+
+  def convertHiveTableToCatalogTableError(
+      e: SparkException, dbName: String, tableName: String): Throwable = {
+    new SparkException(s"${e.getMessage}, db: $dbName, table: $tableName", e)
+  }
+
+  def cannotRecognizeHiveTypeError(
+      e: ParseException, fieldType: String, fieldName: String): Throwable = {
+    new SparkException(
+      s"Cannot recognize hive type string: $fieldType, column: $fieldName", e)
+  }
+
+  def getTablesByTypeUnsupportedByLowerVersionHiveError(): Throwable = {
+    new UnsupportedOperationException("Hive 2.2 and lower versions don't 
support " +
+      "getTablesByType. Please use Hive 2.3 or higher version.")
+  }
+
+  def dropTableWithPurgeUnsupportedError(): Throwable = {
+    new UnsupportedOperationException("DROP TABLE ... PURGE")
+  }
+
+  def alterTableWithDropPartitionAndPurgeUnsupportedError(): Throwable = {
+    new UnsupportedOperationException("ALTER TABLE ... DROP PARTITION ... 
PURGE")
+  }
+
+  def invalidPartitionFilterError(): Throwable = {
+    new UnsupportedOperationException(
+      """Partition filter cannot have both `"` and `'` characters""")
+  }
+
+  def getPartitionMetadataByFilterFromError(e: InvocationTargetException): 
Throwable = {

Review comment:
       getPartitionMetadataByFilterError




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