cloud-fan commented on code in PR #37483:
URL: https://github.com/apache/spark/pull/37483#discussion_r949757048


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/errors/QueryExecutionErrors.scala:
##########
@@ -169,6 +169,39 @@ private[sql] object QueryExecutionErrors extends 
QueryErrorsBase {
       summary = getSummary(context))
   }
 
+  def invalidInputInConversionError(
+      to: DataType,
+      s: UTF8String,
+      fmt: UTF8String,
+      hint: String = "",
+      context: SQLQueryContext): SparkIllegalArgumentException = {
+    val alternative = if (hint.nonEmpty) {
+      s" Use '$hint' to tolerate malformed input and return NULL instead."
+    } else ""
+    new SparkIllegalArgumentException(

Review Comment:
   Note: with error class, we don't need different java exception classes and 
can always use `SparkException`. We keep these special exception classes only 
for backward compatibility.



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