Serge Rielau created SPARK-40156:
------------------------------------

             Summary: url_decode() exposes a Java error
                 Key: SPARK-40156
                 URL: https://issues.apache.org/jira/browse/SPARK-40156
             Project: Spark
          Issue Type: Bug
          Components: Spark Core
    Affects Versions: 3.4.0
            Reporter: Serge Rielau


Given a badly encode string Spark returns a Java error.
It should the return an ERROR_CLASS

spark-sql> SELECT url_decode('http%3A%2F%2spark.apache.org');

22/08/20 17:17:20 ERROR SparkSQLDriver: Failed in [SELECT 
url_decode('http%3A%2F%2spark.apache.org')]

java.lang.IllegalArgumentException: URLDecoder: Illegal hex characters in 
escape (%) pattern - Error at index 1 in: "2s"

 at java.base/java.net.URLDecoder.decode(URLDecoder.java:232)

 at java.base/java.net.URLDecoder.decode(URLDecoder.java:142)

 at 
org.apache.spark.sql.catalyst.expressions.UrlCodec$.decode(urlExpressions.scala:113)

 at 
org.apache.spark.sql.catalyst.expressions.UrlCodec.decode(urlExpressions.scala)



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org
For additional commands, e-mail: issues-h...@spark.apache.org

Reply via email to