Zhen Wang created SPARK-48806:
---------------------------------

             Summary: Pass actual exception when url_decode fails
                 Key: SPARK-48806
                 URL: https://issues.apache.org/jira/browse/SPARK-48806
             Project: Spark
          Issue Type: Improvement
          Components: SQL
    Affects Versions: 3.5.1, 4.0.0
            Reporter: Zhen Wang


Currently url_decode function ignores actual exception, which contains 
information that is useful for quickly locating the problem.

 

Like executing this sql:
{code:java}
select url_decode('https%3A%2F%2spark.apache.org'); {code}
We only get the error message:
{code:java}
org.apache.spark.SparkIllegalArgumentException: [CANNOT_DECODE_URL] The 
provided URL cannot be decoded: https%3A%2F%2spark.apache.org. Please ensure 
that the URL is properly formatted and try again.
    at 
org.apache.spark.sql.errors.QueryExecutionErrors$.illegalUrlError(QueryExecutionErrors.scala:376)
    at 
org.apache.spark.sql.catalyst.expressions.UrlCodec$.decode(urlExpressions.scala:118)
    at 
org.apache.spark.sql.catalyst.expressions.UrlCodec.decode(urlExpressions.scala) 
{code}
However, the actual useful exception information is ignored:
{code:java}
java.lang.IllegalArgumentException: URLDecoder: Illegal hex characters in 
escape (%) pattern - Error at index 1 in: "2s" {code}



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

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to