You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by wangmiao1981 <gi...@git.apache.org> on 2016/05/13 23:19:32 UTC

[GitHub] spark pull request: [SPARK-15318][ML][Example]:spark.ml Collaborat...

GitHub user wangmiao1981 opened a pull request:

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

    [SPARK-15318][ML][Example]:spark.ml Collaborative Filtering example does not work in spark-shell

    ## What changes were proposed in this pull request?
    
    (Please fill in changes proposed in this fix)
    
    copy & paste example in ml-collaborative-filtering.html into spark-shell, we see the following errors.
    scala> case class Rating(userId: Int, movieId: Int, rating: Float, timestamp: Long)
    defined class Rating
    
    scala> object Rating {
    def parseRating(str: String): Rating = { | val fields = str.split("::") | assert(fields.size == 4) | Rating(fields(0).toInt, fields(1).toInt, fields(2).toFloat, fields(3).toLong) | }
    }
    <console>:29: error: Rating.type does not take parameters
    Rating(fields(0).toInt, fields(1).toInt, fields(2).toFloat, fields(3).toLong)
    ^
    In standard scala repl, it has the same error.
    
    Scala/spark-shell repl has some quirks (e.g. packages are also not well supported).
    
    The reason of errors is that scala/spark-shell repl discards previous definitions when we define the Object with the same class name. Solution: We can rename the Object Rating.
    
    ## How was this patch tested?
    
    (Please explain how this patch was tested. E.g. unit tests, integration tests, manual tests)
    
    Manually test it: 1). ./bin/run-example ALSExample
    2). copy & paste example in the generated document. It works fine.


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

    $ git pull https://github.com/wangmiao1981/spark repl

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

    https://github.com/apache/spark/pull/13110.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 #13110
    
----
commit cb20cb255b3bd3db6d469952619656c0a9f4bcb9
Author: wm624@hotmail.com <wm...@hotmail.com>
Date:   2016-05-13T23:12:44Z

    rename the Rating

----


---
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-15318][ML][Example]:spark.ml Collaborat...

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

    https://github.com/apache/spark/pull/13110#discussion_r63284035
  
    --- Diff: examples/src/main/scala/org/apache/spark/examples/ml/ALSExample.scala ---
    @@ -28,7 +28,7 @@ object ALSExample {
     
       // $example on$
       case class Rating(userId: Int, movieId: Int, rating: Float, timestamp: Long)
    -  object Rating {
    +  object RatingUtil {
    --- End diff --
    
    I can move it into the main. I think it is not necessary. I will make the change and test it.
    
    Thanks!


---
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-15318][ML][Example]:spark.ml Collaborat...

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

    https://github.com/apache/spark/pull/13110#issuecomment-219183057
  
    **[Test build #58597 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/58597/consoleFull)** for PR 13110 at commit [`cb20cb2`](https://github.com/apache/spark/commit/cb20cb255b3bd3db6d469952619656c0a9f4bcb9).
     * 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-15318][ML][Example]:spark.ml Collaborat...

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

    https://github.com/apache/spark/pull/13110#issuecomment-219313318
  
    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-15318][ML][Example]:spark.ml Collaborat...

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

    https://github.com/apache/spark/pull/13110#issuecomment-219762504
  
    Merged to master/2.0


---
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-15318][ML][Example]:spark.ml Collaborat...

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

    https://github.com/apache/spark/pull/13110#issuecomment-219484431
  
    @yanboliang For JAVA example, class Rating is equivalent to case class Rating in scala example. It is not straightforward to remove class Rating in JAVA. I remove Rating in scala, because copy & paste doesn't work in spark-shell due to scala repl limitation.


---
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-15318][ML][Example]:spark.ml Collaborat...

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

    https://github.com/apache/spark/pull/13110#issuecomment-219313297
  
    **[Test build #58619 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/58619/consoleFull)** for PR 13110 at commit [`18d61d1`](https://github.com/apache/spark/commit/18d61d1ed18df42cfa32c647896fbf2cbcda64a3).
     * 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-15318][ML][Example]:spark.ml Collaborat...

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

    https://github.com/apache/spark/pull/13110#issuecomment-219462905
  
    @wangmiao1981 Since you removed ```Rating``` for Scala example, I think it's better to do same thing for Java/Python example, and we should make them consistent.


---
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-15318][ML][Example]:spark.ml Collaborat...

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

    https://github.com/apache/spark/pull/13110#discussion_r63273137
  
    --- Diff: examples/src/main/scala/org/apache/spark/examples/ml/ALSExample.scala ---
    @@ -28,7 +28,7 @@ object ALSExample {
     
       // $example on$
       case class Rating(userId: Int, movieId: Int, rating: Float, timestamp: Long)
    -  object Rating {
    +  object RatingUtil {
    --- End diff --
    
    Is this object even needed? there's no reason this couldn't just be defined in main?


---
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-15318][ML][Example]:spark.ml Collaborat...

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

    https://github.com/apache/spark/pull/13110#issuecomment-219312924
  
    **[Test build #58619 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/58619/consoleFull)** for PR 13110 at commit [`18d61d1`](https://github.com/apache/spark/commit/18d61d1ed18df42cfa32c647896fbf2cbcda64a3).


---
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-15318][ML][Example]:spark.ml Collaborat...

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

    https://github.com/apache/spark/pull/13110#issuecomment-219659650
  
    The Rating _case class_ was not removed, just the _object_. The Java example has no equivalent and is OK as-is.


---
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-15318][ML][Example]:spark.ml Collaborat...

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

    https://github.com/apache/spark/pull/13110#issuecomment-219183105
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/58597/
    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-15318][ML][Example]:spark.ml Collaborat...

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

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


---
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-15318][ML][Example]:spark.ml Collaborat...

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

    https://github.com/apache/spark/pull/13110#issuecomment-219182172
  
    **[Test build #58597 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/58597/consoleFull)** for PR 13110 at commit [`cb20cb2`](https://github.com/apache/spark/commit/cb20cb255b3bd3db6d469952619656c0a9f4bcb9).


---
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-15318][ML][Example]:spark.ml Collaborat...

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

    https://github.com/apache/spark/pull/13110#issuecomment-219183104
  
    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-15318][ML][Example]:spark.ml Collaborat...

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

    https://github.com/apache/spark/pull/13110#issuecomment-219754259
  
    @wangmiao1981 @srowen Got it. Thanks for kindly remind!


---
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-15318][ML][Example]:spark.ml Collaborat...

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

    https://github.com/apache/spark/pull/13110#issuecomment-219313319
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/58619/
    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