MaxGekk commented on code in PR #44094:
URL: https://github.com/apache/spark/pull/44094#discussion_r1411844367


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/stringExpressions.scala:
##########
@@ -2648,18 +2648,26 @@ case class StringDecode(bin: Expression, charset: 
Expression)
 
   protected override def nullSafeEval(input1: Any, input2: Any): Any = {
     val fromCharset = input2.asInstanceOf[UTF8String].toString
-    UTF8String.fromString(new String(input1.asInstanceOf[Array[Byte]], 
fromCharset))
+    try {
+      UTF8String.fromString(new String(input1.asInstanceOf[Array[Byte]], 
fromCharset))

Review Comment:
   > Shall we introduce the legacyCharsets and supportedCharsets too?
   
   Yep, let me merge this and introduce the restrictions: tests, the migration 
guide and so on.



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