cloud-fan commented on code in PR #44094:
URL: https://github.com/apache/spark/pull/44094#discussion_r1411399827
##########
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:
since we are here, can we rewrite this expression using `StaticInvoke`? To
avoid this problem completely.
--
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]