You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by hvanhovell <gi...@git.apache.org> on 2015/11/09 14:23:40 UTC

[GitHub] spark pull request: [SPARK-11594][SQL][REPL] Cannot create UDAF in...

GitHub user hvanhovell opened a pull request:

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

    [SPARK-11594][SQL][REPL] Cannot create UDAF in REPL

    This PR enables users to create a UDAF in the REPL without getting a ```java.lang.InternalError```.

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

    $ git pull https://github.com/hvanhovell/spark SPARK-11594

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

    https://github.com/apache/spark/pull/9568.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 #9568
    
----
commit 401230c51ad93425c90ec3c58746dbfba154410c
Author: Herman van Hovell <hv...@questtec.nl>
Date:   2015-11-09T13:21:29Z

    Enable the creation of a UDAF in the REPL.

----


---
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: [SPARK-11594][SQL][REPL] Cannot create UDAF in...

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

    https://github.com/apache/spark/pull/9568#discussion_r44469882
  
    --- Diff: sql/core/src/main/scala/org/apache/spark/sql/execution/aggregate/udaf.scala ---
    @@ -452,7 +452,7 @@ private[sql] case class ScalaUDAF(
       }
     
       override def toString: String = {
    -    s"""${udaf.getClass.getSimpleName}(${children.mkString(",")})"""
    --- End diff --
    
    The ```getSimpleName``` call on the defined class causes the internal error.


---
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: [SPARK-11594][SQL][REPL] Cannot create UDAF in...

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

    https://github.com/apache/spark/pull/9568#discussion_r44450530
  
    --- Diff: sql/core/src/main/scala/org/apache/spark/sql/execution/aggregate/udaf.scala ---
    @@ -452,7 +452,7 @@ private[sql] case class ScalaUDAF(
       }
     
       override def toString: String = {
    -    s"""${udaf.getClass.getSimpleName}(${children.mkString(",")})"""
    --- End diff --
    
    So, this is the cause of that `InternalError`?


---
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: [SPARK-11594][SQL][REPL] Cannot create UDAF in...

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

    https://github.com/apache/spark/pull/9568#discussion_r44487589
  
    --- Diff: sql/core/src/main/scala/org/apache/spark/sql/expressions/udaf.scala ---
    @@ -129,6 +129,13 @@ abstract class UserDefinedAggregateFunction extends Serializable {
             isDistinct = true)
         Column(aggregateExpression)
       }
    +
    +  /**
    +    * The name of the UDAF. This is currently the simple name of class. This can create an
    +    * [[java.lang.InternalError]] if the UDAF class was created in the REPL; override this method
    +    * in these cases.
    +    */
    +  def name: String = getClass.getSimpleName
    --- End diff --
    
    I am wondering if we can catch the error and re-throw it with a more informative error message? In our error message, we can let the user know he/she needs to override `def name` to workaround that Scala issue.


---
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: [SPARK-11594][SQL][REPL] Cannot create UDAF in...

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

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


---
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: [SPARK-11594][SQL][REPL] Cannot create UDAF in...

Posted by hvanhovell <gi...@git.apache.org>.
Github user hvanhovell commented on the pull request:

    https://github.com/apache/spark/pull/9568#issuecomment-155710292
  
    Move to scala 2.10.5 fixed this. Closing PR.


---
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: [SPARK-11594][SQL][REPL] Cannot create UDAF in...

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

    https://github.com/apache/spark/pull/9568#discussion_r44273796
  
    --- Diff: sql/core/src/main/scala/org/apache/spark/sql/expressions/udaf.scala ---
    @@ -129,6 +129,13 @@ abstract class UserDefinedAggregateFunction extends Serializable {
             isDistinct = true)
         Column(aggregateExpression)
       }
    +
    +  /**
    +    * The name of the UDAF. This is currently the simple name of class. This can create an
    +    * [[java.lang.InternalError]] if the UDAF class was created in the REPL; override this method
    +    * in these cases.
    +    */
    +  def name: String = getClass.getSimpleName
    --- End diff --
    
    I am not catching a ```java.lang.InternalError``` here, because I think these shouldn't be caught at all (the error could have different cause). We enable the use to redefine the name to work arround this problem.


---
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: [SPARK-11594][SQL][REPL] Cannot create UDAF in...

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

    https://github.com/apache/spark/pull/9568#issuecomment-155060826
  
    Merged build started.


---
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: [SPARK-11594][SQL][REPL] Cannot create UDAF in...

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

    https://github.com/apache/spark/pull/9568#issuecomment-155064676
  
    **[Test build #45364 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/45364/consoleFull)** for PR 9568 at commit [`401230c`](https://github.com/apache/spark/commit/401230c51ad93425c90ec3c58746dbfba154410c).


---
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: [SPARK-11594][SQL][REPL] Cannot create UDAF in...

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

    https://github.com/apache/spark/pull/9568#issuecomment-155118230
  
    **[Test build #45364 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/45364/consoleFull)** for PR 9568 at commit [`401230c`](https://github.com/apache/spark/commit/401230c51ad93425c90ec3c58746dbfba154410c).
     * 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: [SPARK-11594][SQL][REPL] Cannot create UDAF in...

Posted by yhuai <gi...@git.apache.org>.
Github user yhuai commented on the pull request:

    https://github.com/apache/spark/pull/9568#issuecomment-155587438
  
    How about we add the link to the scala issue in our description and in our code comment?


---
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: [SPARK-11594][SQL][REPL] Cannot create UDAF in...

Posted by hvanhovell <gi...@git.apache.org>.
Github user hvanhovell commented on the pull request:

    https://github.com/apache/spark/pull/9568#issuecomment-155589310
  
    Sounds like a good idea. I'll add this in the morning.


---
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: [SPARK-11594][SQL][REPL] Cannot create UDAF in...

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

    https://github.com/apache/spark/pull/9568#issuecomment-155118459
  
    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: [SPARK-11594][SQL][REPL] Cannot create UDAF in...

Posted by hvanhovell <gi...@git.apache.org>.
Github user hvanhovell commented on the pull request:

    https://github.com/apache/spark/pull/9568#issuecomment-155582285
  
    This is actually a scala problem: https://issues.scala-lang.org/browse/SI-9051


---
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: [SPARK-11594][SQL][REPL] Cannot create UDAF in...

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

    https://github.com/apache/spark/pull/9568#issuecomment-155060787
  
     Merged build triggered.


---
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