You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spark.apache.org by ma...@apache.org on 2022/08/30 08:14:51 UTC

[spark] branch master updated: [SPARK-40156][SQL][TESTS][FOLLOW-UP] `url_decode()` should the return an error class

This is an automated email from the ASF dual-hosted git repository.

maxgekk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/spark.git


The following commit(s) were added to refs/heads/master by this push:
     new 7a5ce219d0d [SPARK-40156][SQL][TESTS][FOLLOW-UP] `url_decode()` should the return an error class
7a5ce219d0d is described below

commit 7a5ce219d0d755235931bb1e36e0195884f58588
Author: zhiming she <50...@qq.com>
AuthorDate: Tue Aug 30 11:14:30 2022 +0300

    [SPARK-40156][SQL][TESTS][FOLLOW-UP] `url_decode()` should the return an error class
    
    ### What changes were proposed in this pull request?
    
    url_decode() return an error class when Invalid parameter input. like :
    ```
    spark.sql("SELECT url_decode('http%3A%2F%2spark.apache.org')").show
    ```
    
    output:
    ```
    org.apache.spark.SparkIllegalArgumentException: [CANNOT_DECODE_URL] Cannot decode url : http%3A%2F%2spark.apache.org.
    ```
    
    ### Why are the changes needed?
    
    To improve user experience w/ Spark SQL.
    
    ### Does this PR introduce _any_ user-facing change?
    
    no
    
    ### How was this patch tested?
    
    ```
    $ build/sbt "sql/testOnly org.apache.spark.sql.SQLQueryTestSuite -- -z url-functions.sql"
    ```
    
    Closes #37709 from zzzzming95/SPARK-40156-test.
    
    Authored-by: zhiming she <50...@qq.com>
    Signed-off-by: Max Gekk <ma...@gmail.com>
---
 .../main/scala/org/apache/spark/sql/errors/QueryExecutionErrors.scala  | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/sql/catalyst/src/main/scala/org/apache/spark/sql/errors/QueryExecutionErrors.scala b/sql/catalyst/src/main/scala/org/apache/spark/sql/errors/QueryExecutionErrors.scala
index d8d6139e919..8cb31f45c25 100644
--- a/sql/catalyst/src/main/scala/org/apache/spark/sql/errors/QueryExecutionErrors.scala
+++ b/sql/catalyst/src/main/scala/org/apache/spark/sql/errors/QueryExecutionErrors.scala
@@ -325,8 +325,7 @@ private[sql] object QueryExecutionErrors extends QueryErrorsBase {
       s"If necessary set ${SQLConf.ANSI_ENABLED.key} to false to bypass this error.", e)
   }
 
-  def illegalUrlError(url: UTF8String):
-  Throwable with SparkThrowable = {
+  def illegalUrlError(url: UTF8String): Throwable = {
     new SparkIllegalArgumentException(errorClass = "CANNOT_DECODE_URL",
       messageParameters = Array(url.toString)
     )


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@spark.apache.org
For additional commands, e-mail: commits-help@spark.apache.org