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

url_decode() exposes a Java error

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 3.4.0
    • 3.4.0
    • Spark Core
    • None

    Description

      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)

      Attachments

        Activity

          People

            Unassigned Unassigned
            srielau Serge Rielau
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: