You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by gatorsmile <gi...@git.apache.org> on 2017/07/09 03:56:14 UTC

[GitHub] spark pull request #18574: [SPARK-21350] [SQL] Fix the error message when th...

GitHub user gatorsmile opened a pull request:

    https://github.com/apache/spark/pull/18574

    [SPARK-21350] [SQL] Fix the error message when the number of arguments is wrong when invoking a UDF

    ### What changes were proposed in this pull request?
    Users get a very confusing error when users specify a wrong number of parameters. 
    ```Scala
        val df = spark.emptyDataFrame
        spark.udf.register("foo", (_: String).length)
        df.selectExpr("foo(2, 3, 4)")
    ```
    ```
    org.apache.spark.sql.UDFSuite$$anonfun$9$$anonfun$apply$mcV$sp$12 cannot be cast to scala.Function3
    java.lang.ClassCastException: org.apache.spark.sql.UDFSuite$$anonfun$9$$anonfun$apply$mcV$sp$12 cannot be cast to scala.Function3
    	at org.apache.spark.sql.catalyst.expressions.ScalaUDF.<init>(ScalaUDF.scala:109)
    ```
    
    This PR is to capture the exception and issue an error message that is consistent with what we did for built-in functions. After the fix, the error message is improved to 
    ```
    Invalid number of arguments for function foo; line 1 pos 0
    org.apache.spark.sql.AnalysisException: Invalid number of arguments for function foo; line 1 pos 0
    	at org.apache.spark.sql.catalyst.analysis.SimpleFunctionRegistry.lookupFunction(FunctionRegistry.scala:119)
    ```
    
    ### How was this patch tested?
    Added a test case

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/gatorsmile/spark statsCheck

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/spark/pull/18574.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #18574
    
----
commit 8302c2a11efa1f444c2b69999fcc94ee4356d2ea
Author: gatorsmile <ga...@gmail.com>
Date:   2017-07-09T03:46:32Z

    fix.

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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


[GitHub] spark issue #18574: [SPARK-21350] [SQL] Fix the error message when the numbe...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/18574
  
    Test FAILed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/79396/
    Test FAILed.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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


[GitHub] spark issue #18574: [SPARK-21350] [SQL] Fix the error message when the numbe...

Posted by gatorsmile <gi...@git.apache.org>.
Github user gatorsmile commented on the issue:

    https://github.com/apache/spark/pull/18574
  
    retest this please


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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


[GitHub] spark issue #18574: [SPARK-21350] [SQL] Fix the error message when the numbe...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/18574
  
    **[Test build #79402 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/79402/testReport)** for PR 18574 at commit [`8302c2a`](https://github.com/apache/spark/commit/8302c2a11efa1f444c2b69999fcc94ee4356d2ea).


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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


[GitHub] spark issue #18574: [SPARK-21350] [SQL] Fix the error message when the numbe...

Posted by dongjoon-hyun <gi...@git.apache.org>.
Github user dongjoon-hyun commented on the issue:

    https://github.com/apache/spark/pull/18574
  
    Retest this please.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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


[GitHub] spark issue #18574: [SPARK-21350] [SQL] Fix the error message when the numbe...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/18574
  
    Merged build finished. Test FAILed.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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


[GitHub] spark issue #18574: [SPARK-21350] [SQL] Fix the error message when the numbe...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/18574
  
    Merged build finished. Test PASSed.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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


[GitHub] spark pull request #18574: [SPARK-21350] [SQL] Fix the error message when th...

Posted by cloud-fan <gi...@git.apache.org>.
Github user cloud-fan commented on a diff in the pull request:

    https://github.com/apache/spark/pull/18574#discussion_r126356309
  
    --- Diff: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/FunctionRegistry.scala ---
    @@ -112,7 +112,12 @@ class SimpleFunctionRegistry extends FunctionRegistry {
             throw new AnalysisException(s"undefined function $name")
           }
         }
    -    func(children)
    +    try {
    +      func(children)
    --- End diff --
    
    I mean something like
    ```
      def register[RT: TypeTag](name: String, func: Function0[RT]): UserDefinedFunction = {
        val ScalaReflection.Schema(dataType, nullable) = ScalaReflection.schemaFor[RT]
        val inputTypes = Try(Nil).toOption
        def builder(e: Seq[Expression]) = {
          if (e.length != 0) {
            throw ...
          } else {
            ScalaUDF(func, dataType, e, inputTypes.getOrElse(Nil), Some(name), nullable)
          }
        }
        functionRegistry.createOrReplaceTempFunction(name, builder)
        UserDefinedFunction(func, dataType, inputTypes).withName(name).withNullability(nullable)
      }
    ```


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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


[GitHub] spark pull request #18574: [SPARK-21350] [SQL] Fix the error message when th...

Posted by kiszk <gi...@git.apache.org>.
Github user kiszk commented on a diff in the pull request:

    https://github.com/apache/spark/pull/18574#discussion_r126365395
  
    --- Diff: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/FunctionRegistry.scala ---
    @@ -112,7 +112,12 @@ class SimpleFunctionRegistry extends FunctionRegistry {
             throw new AnalysisException(s"undefined function $name")
           }
         }
    -    func(children)
    +    try {
    +      func(children)
    +    } catch {
    +      case _: ClassCastException =>
    --- End diff --
    
    Sorry, I made mistake. I realized the original exception happen in the stack trace that does not execute the body.
    
    ```
    Caused by: java.lang.ClassCastException: org.apache.spark.sql.UDFSuite$$anonfun$9$$anonfun$29$$anonfun$apply$1 cannot be cast to scala.Function3
    	at org.apache.spark.sql.catalyst.expressions.ScalaUDF.<init>(ScalaUDF.scala:109)
    	at org.apache.spark.sql.UDFRegistration.org$apache$spark$sql$UDFRegistration$$builder$4(UDFRegistration.scala:160)
    	at org.apache.spark.sql.UDFRegistration$$anonfun$register$4.apply(UDFRegistration.scala:161)
    	at org.apache.spark.sql.UDFRegistration$$anonfun$register$4.apply(UDFRegistration.scala:161)
    	at org.apache.spark.sql.catalyst.analysis.SimpleFunctionRegistry.lookupFunction(FunctionRegistry.scala:115)
    ...
    ```


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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


[GitHub] spark issue #18574: [SPARK-21350] [SQL] Fix the error message when the numbe...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/18574
  
    **[Test build #79400 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/79400/testReport)** for PR 18574 at commit [`8302c2a`](https://github.com/apache/spark/commit/8302c2a11efa1f444c2b69999fcc94ee4356d2ea).


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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


[GitHub] spark issue #18574: [SPARK-21350] [SQL] Fix the error message when the numbe...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/18574
  
    **[Test build #79472 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/79472/testReport)** for PR 18574 at commit [`5448be9`](https://github.com/apache/spark/commit/5448be96728ae1043d124433fc3521f538b6ca7a).


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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


[GitHub] spark issue #18574: [SPARK-21350] [SQL] Fix the error message when the numbe...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/18574
  
    **[Test build #79486 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/79486/testReport)** for PR 18574 at commit [`5448be9`](https://github.com/apache/spark/commit/5448be96728ae1043d124433fc3521f538b6ca7a).


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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


[GitHub] spark issue #18574: [SPARK-21350] [SQL] Fix the error message when the numbe...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/18574
  
    Merged build finished. Test PASSed.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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


[GitHub] spark issue #18574: [SPARK-21350] [SQL] Fix the error message when the numbe...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/18574
  
    Test FAILed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/79472/
    Test FAILed.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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


[GitHub] spark issue #18574: [SPARK-21350] [SQL] Fix the error message when the numbe...

Posted by gatorsmile <gi...@git.apache.org>.
Github user gatorsmile commented on the issue:

    https://github.com/apache/spark/pull/18574
  
    cc @cloud-fan 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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


[GitHub] spark issue #18574: [SPARK-21350] [SQL] Fix the error message when the numbe...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/18574
  
    Merged build finished. Test FAILed.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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


[GitHub] spark pull request #18574: [SPARK-21350] [SQL] Fix the error message when th...

Posted by gatorsmile <gi...@git.apache.org>.
Github user gatorsmile commented on a diff in the pull request:

    https://github.com/apache/spark/pull/18574#discussion_r126349469
  
    --- Diff: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/FunctionRegistry.scala ---
    @@ -112,7 +112,12 @@ class SimpleFunctionRegistry extends FunctionRegistry {
             throw new AnalysisException(s"undefined function $name")
           }
         }
    -    func(children)
    +    try {
    +      func(children)
    +    } catch {
    +      case _: ClassCastException =>
    --- End diff --
    
    This is not executing the function, but just finding the function. Will it trigger ClassCastException that occurred in a function body of the given UDF? Could you give me an example?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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


[GitHub] spark issue #18574: [SPARK-21350] [SQL] Fix the error message when the numbe...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/18574
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/79486/
    Test PASSed.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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


[GitHub] spark issue #18574: [SPARK-21350] [SQL] Fix the error message when the numbe...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/18574
  
    Test FAILed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/79400/
    Test FAILed.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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


[GitHub] spark pull request #18574: [SPARK-21350] [SQL] Fix the error message when th...

Posted by gatorsmile <gi...@git.apache.org>.
Github user gatorsmile commented on a diff in the pull request:

    https://github.com/apache/spark/pull/18574#discussion_r126349037
  
    --- Diff: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/FunctionRegistry.scala ---
    @@ -112,7 +112,12 @@ class SimpleFunctionRegistry extends FunctionRegistry {
             throw new AnalysisException(s"undefined function $name")
           }
         }
    -    func(children)
    +    try {
    +      func(children)
    --- End diff --
    
    This is a scala function. It might be harder to do it. 
    
    If using the case match, it might be looks like?
    ```
        func match {
          case f: Function0[_] if children.size != 0 => ...
          case f: Function1[_, _] if children.size != 1 => ...
          ...
    ```


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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


[GitHub] spark pull request #18574: [SPARK-21350] [SQL] Fix the error message when th...

Posted by kiszk <gi...@git.apache.org>.
Github user kiszk commented on a diff in the pull request:

    https://github.com/apache/spark/pull/18574#discussion_r126343507
  
    --- Diff: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/FunctionRegistry.scala ---
    @@ -112,7 +112,12 @@ class SimpleFunctionRegistry extends FunctionRegistry {
             throw new AnalysisException(s"undefined function $name")
           }
         }
    -    func(children)
    +    try {
    +      func(children)
    +    } catch {
    +      case _: ClassCastException =>
    --- End diff --
    
    Can we catch all of `ClassCastException`? I think that only this exception for ` scala.Function?` is related to wrong number of arguments.
    This code may unexpectedly catch `ClassCastException` that occurred in a function body of given UDF.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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


[GitHub] spark issue #18574: [SPARK-21350] [SQL] Fix the error message when the numbe...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/18574
  
    Merged build finished. Test PASSed.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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


[GitHub] spark issue #18574: [SPARK-21350] [SQL] Fix the error message when the numbe...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/18574
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/79402/
    Test PASSed.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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


[GitHub] spark issue #18574: [SPARK-21350] [SQL] Fix the error message when the numbe...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/18574
  
    **[Test build #79400 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/79400/testReport)** for PR 18574 at commit [`8302c2a`](https://github.com/apache/spark/commit/8302c2a11efa1f444c2b69999fcc94ee4356d2ea).
     * This patch **fails due to an unknown error code, -9**.
     * This patch merges cleanly.
     * This patch adds no public classes.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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


[GitHub] spark issue #18574: [SPARK-21350] [SQL] Fix the error message when the numbe...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/18574
  
    **[Test build #79402 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/79402/testReport)** for PR 18574 at commit [`8302c2a`](https://github.com/apache/spark/commit/8302c2a11efa1f444c2b69999fcc94ee4356d2ea).
     * This patch passes all tests.
     * This patch merges cleanly.
     * This patch adds no public classes.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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


[GitHub] spark issue #18574: [SPARK-21350] [SQL] Fix the error message when the numbe...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/18574
  
    **[Test build #79404 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/79404/testReport)** for PR 18574 at commit [`8302c2a`](https://github.com/apache/spark/commit/8302c2a11efa1f444c2b69999fcc94ee4356d2ea).
     * This patch passes all tests.
     * This patch merges cleanly.
     * This patch adds no public classes.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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


[GitHub] spark pull request #18574: [SPARK-21350] [SQL] Fix the error message when th...

Posted by cloud-fan <gi...@git.apache.org>.
Github user cloud-fan commented on a diff in the pull request:

    https://github.com/apache/spark/pull/18574#discussion_r126330636
  
    --- Diff: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/FunctionRegistry.scala ---
    @@ -112,7 +112,12 @@ class SimpleFunctionRegistry extends FunctionRegistry {
             throw new AnalysisException(s"undefined function $name")
           }
         }
    -    func(children)
    +    try {
    +      func(children)
    --- End diff --
    
    Although this is the simplest fix, I think ideally it's the `FunctionBuilder`'s responsibility to check invalid number of arguments, like the built-in function's `FunctionBuilder` does.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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


[GitHub] spark issue #18574: [SPARK-21350] [SQL] Fix the error message when the numbe...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/18574
  
    Merged build finished. Test FAILed.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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


[GitHub] spark issue #18574: [SPARK-21350] [SQL] Fix the error message when the numbe...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/18574
  
    **[Test build #79396 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/79396/testReport)** for PR 18574 at commit [`8302c2a`](https://github.com/apache/spark/commit/8302c2a11efa1f444c2b69999fcc94ee4356d2ea).


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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


[GitHub] spark pull request #18574: [SPARK-21350] [SQL] Fix the error message when th...

Posted by cloud-fan <gi...@git.apache.org>.
Github user cloud-fan commented on a diff in the pull request:

    https://github.com/apache/spark/pull/18574#discussion_r126587004
  
    --- Diff: sql/core/src/main/scala/org/apache/spark/sql/UDFRegistration.scala ---
    @@ -123,16 +128,20 @@ class UDFRegistration private[sql] (functionRegistry: FunctionRegistry) extends
           val anyCast = s".asInstanceOf[UDF$i[$anyTypeArgs, Any]]"
           val anyParams = (1 to i).map(_ => "_: Any").mkString(", ")
           println(s"""
    -         |/**
    -         | * Register a user-defined function with ${i} arguments.
    -         | * @since 1.3.0
    -         | */
    -         |def register(name: String, f: UDF$i[$extTypeArgs, _], returnType: DataType): Unit = {
    -         |  val func = f$anyCast.call($anyParams)
    -         |  functionRegistry.createOrReplaceTempFunction(
    -         |    name,
    -         |    (e: Seq[Expression]) => ScalaUDF(func, returnType, e))
    -         |}""".stripMargin)
    +        |/**
    +        | * Register a user-defined function with ${i} arguments.
    +        | * @since 1.3.0
    +        | */
    +        |def register(name: String, f: UDF$i[$extTypeArgs, _], returnType: DataType): Unit = {
    --- End diff --
    
    do you know why we don't have `UDF0`?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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


[GitHub] spark issue #18574: [SPARK-21350] [SQL] Fix the error message when the numbe...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/18574
  
    **[Test build #79396 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/79396/testReport)** for PR 18574 at commit [`8302c2a`](https://github.com/apache/spark/commit/8302c2a11efa1f444c2b69999fcc94ee4356d2ea).
     * This patch **fails PySpark pip packaging tests**.
     * This patch merges cleanly.
     * This patch adds no public classes.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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


[GitHub] spark pull request #18574: [SPARK-21350] [SQL] Fix the error message when th...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/spark/pull/18574


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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


[GitHub] spark pull request #18574: [SPARK-21350] [SQL] Fix the error message when th...

Posted by gatorsmile <gi...@git.apache.org>.
Github user gatorsmile commented on a diff in the pull request:

    https://github.com/apache/spark/pull/18574#discussion_r126484159
  
    --- Diff: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/FunctionRegistry.scala ---
    @@ -112,7 +112,12 @@ class SimpleFunctionRegistry extends FunctionRegistry {
             throw new AnalysisException(s"undefined function $name")
           }
         }
    -    func(children)
    +    try {
    +      func(children)
    --- End diff --
    
    Sounds good! : )


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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


[GitHub] spark issue #18574: [SPARK-21350] [SQL] Fix the error message when the numbe...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/18574
  
    **[Test build #79404 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/79404/testReport)** for PR 18574 at commit [`8302c2a`](https://github.com/apache/spark/commit/8302c2a11efa1f444c2b69999fcc94ee4356d2ea).


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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


[GitHub] spark issue #18574: [SPARK-21350] [SQL] Fix the error message when the numbe...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/18574
  
    **[Test build #79472 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/79472/testReport)** for PR 18574 at commit [`5448be9`](https://github.com/apache/spark/commit/5448be96728ae1043d124433fc3521f538b6ca7a).
     * This patch **fails SparkR unit tests**.
     * This patch merges cleanly.
     * This patch adds no public classes.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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


[GitHub] spark issue #18574: [SPARK-21350] [SQL] Fix the error message when the numbe...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/18574
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/79404/
    Test PASSed.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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


[GitHub] spark issue #18574: [SPARK-21350] [SQL] Fix the error message when the numbe...

Posted by cloud-fan <gi...@git.apache.org>.
Github user cloud-fan commented on the issue:

    https://github.com/apache/spark/pull/18574
  
    LGTM, merging to master!


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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


[GitHub] spark issue #18574: [SPARK-21350] [SQL] Fix the error message when the numbe...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/18574
  
    **[Test build #79486 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/79486/testReport)** for PR 18574 at commit [`5448be9`](https://github.com/apache/spark/commit/5448be96728ae1043d124433fc3521f538b6ca7a).
     * This patch passes all tests.
     * This patch merges cleanly.
     * This patch adds no public classes.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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


[GitHub] spark pull request #18574: [SPARK-21350] [SQL] Fix the error message when th...

Posted by gatorsmile <gi...@git.apache.org>.
Github user gatorsmile commented on a diff in the pull request:

    https://github.com/apache/spark/pull/18574#discussion_r126591307
  
    --- Diff: sql/core/src/main/scala/org/apache/spark/sql/UDFRegistration.scala ---
    @@ -123,16 +128,20 @@ class UDFRegistration private[sql] (functionRegistry: FunctionRegistry) extends
           val anyCast = s".asInstanceOf[UDF$i[$anyTypeArgs, Any]]"
           val anyParams = (1 to i).map(_ => "_: Any").mkString(", ")
           println(s"""
    -         |/**
    -         | * Register a user-defined function with ${i} arguments.
    -         | * @since 1.3.0
    -         | */
    -         |def register(name: String, f: UDF$i[$extTypeArgs, _], returnType: DataType): Unit = {
    -         |  val func = f$anyCast.call($anyParams)
    -         |  functionRegistry.createOrReplaceTempFunction(
    -         |    name,
    -         |    (e: Seq[Expression]) => ScalaUDF(func, returnType, e))
    -         |}""".stripMargin)
    +        |/**
    +        | * Register a user-defined function with ${i} arguments.
    +        | * @since 1.3.0
    +        | */
    +        |def register(name: String, f: UDF$i[$extTypeArgs, _], returnType: DataType): Unit = {
    --- End diff --
    
    ok. We can add it. Let me submit a quick fix for this.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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


[GitHub] spark issue #18574: [SPARK-21350] [SQL] Fix the error message when the numbe...

Posted by dongjoon-hyun <gi...@git.apache.org>.
Github user dongjoon-hyun commented on the issue:

    https://github.com/apache/spark/pull/18574
  
    Retest this please


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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