Uploaded image for project: 'Spark'
  1. Spark
  2. SPARK-48806

Pass actual exception when url_decode fails

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 4.0.0, 3.5.1
    • 4.0.0, 3.5.2
    • SQL

    Description

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

       

      Like executing this sql:

      select url_decode('https%3A%2F%2spark.apache.org'); 

      We only get the error message:

      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) 

      However, the actual useful exception information is ignored:

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

      Attachments

        Issue Links

          Activity

            People

              wforget Zhen Wang
              wforget Zhen Wang
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: