You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by evanyc15 <gi...@git.apache.org> on 2015/12/16 21:29:15 UTC

[GitHub] spark pull request: [SPARK-12376][TESTS] Spark Streaming Java8APIS...

GitHub user evanyc15 opened a pull request:

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

    [SPARK-12376][TESTS] Spark Streaming Java8APISuite fails in assertOrderInvariantEquals method

    org.apache.spark.streaming.Java8APISuite.java is failing due to trying to sort immutable list in assertOrderInvariantEquals method.

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

    $ git pull https://github.com/evanyc15/spark SPARK-12376-StreamingJavaAPISuite

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

    https://github.com/apache/spark/pull/10336.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 #10336
    
----
commit 28ff404c59aeff1b6604b70fb153d4d33e21635b
Author: Evan Chen <ch...@us.ibm.com>
Date:   2015-12-16T20:27:51Z

    Changes to Spark Streaming Java8APISuite.java

----


---
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-12376][TESTS] Spark Streaming Java8APIS...

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

    https://github.com/apache/spark/pull/10336#issuecomment-165236230
  
    Can one of the admins verify this patch?


---
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-12376][TESTS] Spark Streaming Java8APIS...

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

    https://github.com/apache/spark/pull/10336#discussion_r47840130
  
    --- Diff: extras/java8-tests/src/test/java/org/apache/spark/streaming/Java8APISuite.java ---
    @@ -440,8 +441,13 @@ public void testPairFlatMap() {
       public static <T extends Comparable<T>> void assertOrderInvariantEquals(
         List<List<T>> expected, List<List<T>> actual) {
         expected.forEach((List<T> list) -> Collections.sort(list));
    -    actual.forEach((List<T> list) -> Collections.sort(list));
    -    Assert.assertEquals(expected, actual);
    +    List<List<T>> sortedActual = new ArrayList<>();
    +    actual.forEach((List<T> list) -> {
    --- End diff --
    
    The arg does not need a type.


---
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-12376][TESTS] Spark Streaming Java8APIS...

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

    https://github.com/apache/spark/pull/10336#issuecomment-165599161
  
    LGTM. Merging to master and 1.6


---
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-12376][TESTS] Spark Streaming Java8APIS...

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

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


---
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-12376][TESTS] Spark Streaming Java8APIS...

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

    https://github.com/apache/spark/pull/10336#discussion_r47838157
  
    --- Diff: extras/java8-tests/src/test/java/org/apache/spark/streaming/Java8APISuite.java ---
    @@ -440,8 +441,13 @@ public void testPairFlatMap() {
       public static <T extends Comparable<T>> void assertOrderInvariantEquals(
         List<List<T>> expected, List<List<T>> actual) {
         expected.forEach((List<T> list) -> Collections.sort(list));
    -    actual.forEach((List<T> list) -> Collections.sort(list));
    -    Assert.assertEquals(expected, actual);
    +    ArrayList<ArrayList<T>> sortedActual = new ArrayList<ArrayList<T>>();
    +    actual.forEach((List<T> list) -> {
    --- End diff --
    
    Hey srowen,
    
    I feel like this can be more confusing to follow. Does your code alternative have any increases in performance?
    
    Thank you


---
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-12376][TESTS] Spark Streaming Java8APIS...

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

    https://github.com/apache/spark/pull/10336#discussion_r47840095
  
    --- Diff: extras/java8-tests/src/test/java/org/apache/spark/streaming/Java8APISuite.java ---
    @@ -25,6 +25,7 @@
     import com.google.common.base.Optional;
     import com.google.common.collect.Lists;
     import com.google.common.collect.Sets;
    +import com.google.common.collect.Ordering;
    --- End diff --
    
    I don't think this is used.


---
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-12376][TESTS] Spark Streaming Java8APIS...

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

    https://github.com/apache/spark/pull/10336#discussion_r47839846
  
    --- Diff: extras/java8-tests/src/test/java/org/apache/spark/streaming/Java8APISuite.java ---
    @@ -440,8 +441,13 @@ public void testPairFlatMap() {
       public static <T extends Comparable<T>> void assertOrderInvariantEquals(
         List<List<T>> expected, List<List<T>> actual) {
         expected.forEach((List<T> list) -> Collections.sort(list));
    -    actual.forEach((List<T> list) -> Collections.sort(list));
    -    Assert.assertEquals(expected, actual);
    +    ArrayList<ArrayList<T>> sortedActual = new ArrayList<ArrayList<T>>();
    +    actual.forEach((List<T> list) -> {
    --- End diff --
    
    Really? it's a little less code and matches the functional style of other (Scala) code. Performance is not an issue here. However I forgot the collect(). How about:
    
    ```
    List<List<T>> actualSorted = actual.stream().
      map(l -> new ArrayList<>(l)).map(Collections::sort).
      collect(Collectors.toList());
    ```



---
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-12376][TESTS] Spark Streaming Java8APIS...

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

    https://github.com/apache/spark/pull/10336#issuecomment-165599347
  
    Thanks @evanyc15 


---
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-12376][TESTS] Spark Streaming Java8APIS...

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

    https://github.com/apache/spark/pull/10336#issuecomment-165522251
  
    **[Test build #2223 has finished](https://amplab.cs.berkeley.edu/jenkins/job/NewSparkPullRequestBuilder/2223/consoleFull)** for PR 10336 at commit [`8addf75`](https://github.com/apache/spark/commit/8addf75bd064f7f02bcb5373bb84d7d925a5f0eb).
     * 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-12376][TESTS] Spark Streaming Java8APIS...

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

    https://github.com/apache/spark/pull/10336#discussion_r47829739
  
    --- Diff: extras/java8-tests/src/test/java/org/apache/spark/streaming/Java8APISuite.java ---
    @@ -440,8 +441,13 @@ public void testPairFlatMap() {
       public static <T extends Comparable<T>> void assertOrderInvariantEquals(
         List<List<T>> expected, List<List<T>> actual) {
         expected.forEach((List<T> list) -> Collections.sort(list));
    -    actual.forEach((List<T> list) -> Collections.sort(list));
    -    Assert.assertEquals(expected, actual);
    +    ArrayList<ArrayList<T>> sortedActual = new ArrayList<ArrayList<T>>();
    +    actual.forEach((List<T> list) -> {
    --- End diff --
    
    Can this be cleverer, like 
    
    ```
    List<List<T>> actualSorted = actual.stream().map(unsorted -> {
      List<T> sorted = new ArrayList<>(unsorted);
      Collections.sort(sorted);
      return sorted;
    });
    ```


---
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-12376][TESTS] Spark Streaming Java8APIS...

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

    https://github.com/apache/spark/pull/10336#discussion_r47829614
  
    --- Diff: extras/java8-tests/src/test/java/org/apache/spark/streaming/Java8APISuite.java ---
    @@ -440,8 +441,13 @@ public void testPairFlatMap() {
       public static <T extends Comparable<T>> void assertOrderInvariantEquals(
         List<List<T>> expected, List<List<T>> actual) {
         expected.forEach((List<T> list) -> Collections.sort(list));
    -    actual.forEach((List<T> list) -> Collections.sort(list));
    -    Assert.assertEquals(expected, actual);
    +    ArrayList<ArrayList<T>> sortedActual = new ArrayList<ArrayList<T>>();
    --- End diff --
    
    I think this can be `List<List<T>> sortedActual = new ArrayList<>();` right? And similarly below.


---
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-12376][TESTS] Spark Streaming Java8APIS...

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

    https://github.com/apache/spark/pull/10336#issuecomment-165480439
  
    LGTM


---
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-12376][TESTS] Spark Streaming Java8APIS...

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

    https://github.com/apache/spark/pull/10336#issuecomment-165481104
  
    **[Test build #2223 has started](https://amplab.cs.berkeley.edu/jenkins/job/NewSparkPullRequestBuilder/2223/consoleFull)** for PR 10336 at commit [`8addf75`](https://github.com/apache/spark/commit/8addf75bd064f7f02bcb5373bb84d7d925a5f0eb).


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