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



##########
File path: 
sql/catalyst/src/main/scala/org/apache/spark/sql/QueryCompilationErrors.scala
##########
@@ -662,4 +662,62 @@ object QueryCompilationErrors {
   def cannotReadCorruptedTablePropertyError(key: String, details: String = 
""): Throwable = {
     new AnalysisException(s"Cannot read table property '$key' as it's 
corrupted.$details")
   }
+
+  def invalidSchemaStringError(exp: Expression): Throwable = {
+    new AnalysisException(s"The expression '${exp.sql}' is not a valid schema 
string.")
+  }
+
+  def schemaMustBeFoldableError(exp: Expression): Throwable = {
+    new AnalysisException(
+      "Schema should be specified in DDL format as a string literal or output 
of " +
+        s"the schema_of_json/schema_of_csv functions instead of ${exp.sql}")
+  }
+
+  def schemaIsNotStructTypeError(dataType: DataType): Throwable = {
+    new AnalysisException(s"Schema should be struct type but got 
${dataType.sql}.")
+  }
+
+  def keyValueInMapNotExpectedError(m: CreateMap): Throwable = {
+    new AnalysisException(
+      s"A type of keys and values in map() must be string, but got 
${m.dataType.catalogString}")
+  }
+
+  def nonMapFunctionNotAllowedError(): Throwable = {
+    new AnalysisException("Must use a map() function for options")
+  }
+
+  def fieldTypeForCorruptRecordNotAllowedError(): Throwable = {
+    new AnalysisException("The field for corrupt records must be string type 
and nullable")
+  }
+
+  def dataTypeUnsupportedByClassError(x: DataType, className: String): 
Throwable = {
+    new AnalysisException(s"DataType '$x' is not supported by $className.")
+  }
+
+  def parseModeUnsupportedError(funcName: String, mode: ParseMode): Throwable 
= {
+    new AnalysisException(s"$funcName() doesn't support the ${mode.name} mode. 
" +
+      s"Acceptable modes are ${PermissiveMode.name} and ${FailFastMode.name}.")
+  }
+
+  def unfoldableFieldUnsupportedError(): Throwable = {
+    new AnalysisException("The field parameter needs to be a foldable string 
value.")
+  }
+
+  def literalOfTypeUnsupportedForSourceTypeError(field: String, source: 
Expression): Throwable = {
+    new AnalysisException(s"Literals of type '$field' are currently not 
supported " +
+      s"for the ${source.dataType.catalogString} type.")
+  }
+
+  def componentTypeUnsupportedInArrayError(clz: Class[_]): Throwable = {

Review comment:
       OK




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