You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@storm.apache.org by HeartSaVioR <gi...@git.apache.org> on 2016/09/19 13:37:26 UTC

[GitHub] storm pull request #1690: STORM-2100 Fix Trident SQL join tests to not rely ...

GitHub user HeartSaVioR opened a pull request:

    https://github.com/apache/storm/pull/1690

    STORM-2100 Fix Trident SQL join tests to not rely on ordering

    Issue link: [STORM-2100](https://issues.apache.org/jira/browse/STORM-2100)
    
    The join doesn't guarantee preserving order (Trident and SQL itself) so we shouldn't rely on that.
    
    Before this patch, tests are failing with JDK7 (with 1.x-branch). I confirmed that this patch makes tests succeed with 1.x-branch & JDK 1.7 (1.7.0_79) combination.
    
    @satishd Could you please review this? Thanks.

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

    $ git pull https://github.com/HeartSaVioR/storm STORM-2100

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

    https://github.com/apache/storm/pull/1690.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 #1690
    
----
commit 78780729d25ddcb56d1997cc8ac3bb61d729067b
Author: Jungtaek Lim <ka...@gmail.com>
Date:   2016-09-19T13:24:26Z

    STORM-2100 Fix Trident SQL join tests to not rely on ordering
    
    * join doesn't guarantee preserving order (Trident and SQL itself)

----


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

[GitHub] storm pull request #1690: STORM-2100 Fix Trident SQL join tests to not rely ...

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

    https://github.com/apache/storm/pull/1690#discussion_r79528978
  
    --- Diff: external/sql/storm-sql-core/src/test/org/apache/storm/sql/compiler/backends/trident/TestPlanCompiler.java ---
    @@ -274,4 +274,9 @@ private void waitForCompletion(long timeout, Callable<Boolean> cond) throws Exce
           Thread.sleep(100);
         }
       }
    +
    +  private void assertArrayWithoutOrder(List<Values> expected, List<List<Object>> actual) {
    +    Assert.assertTrue("Two arrays are not same!\n"+ "Expected: " + expected + "\n" + "Actual: " + actual,
    --- End diff --
    
    minor nit: Can you say `two collections` instead of `two arrays`?


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

[GitHub] storm pull request #1690: STORM-2100 Fix Trident SQL join tests to not rely ...

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

    https://github.com/apache/storm/pull/1690#discussion_r79492402
  
    --- Diff: external/sql/storm-sql-core/src/test/org/apache/storm/sql/compiler/backends/trident/TestPlanCompiler.java ---
    @@ -274,4 +276,9 @@ private void waitForCompletion(long timeout, Callable<Boolean> cond) throws Exce
           Thread.sleep(100);
         }
       }
    +
    +  private void assertArrayWithoutOrder(List<Values> expected, List<List<Object>> actual) {
    +    Assert.assertTrue("Two arrays are not same!\n"+ "Expected: " + expected + "\n" + "Actual: " + actual,
    +            expected.containsAll(actual) && actual.containsAll(expected));
    --- End diff --
    
    @satishd Yes I missed the duplicated items. 
    Btw, if we assume the duplication, checking size equality seems not enough too, since `[a b b a a]` and `[b b a a b]` is same length but it's not actually same. 
    Checking cardinality of each element seems to be the safest way, and if the type of element is comparable, we can copy & sort two arrays and compare with ordered way.


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

[GitHub] storm pull request #1690: STORM-2100 Fix Trident SQL join tests to not rely ...

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

    https://github.com/apache/storm/pull/1690#discussion_r79515076
  
    --- Diff: external/sql/storm-sql-core/src/test/org/apache/storm/sql/compiler/backends/trident/TestPlanCompiler.java ---
    @@ -274,4 +276,9 @@ private void waitForCompletion(long timeout, Callable<Boolean> cond) throws Exce
           Thread.sleep(100);
         }
       }
    +
    +  private void assertArrayWithoutOrder(List<Values> expected, List<List<Object>> actual) {
    +    Assert.assertTrue("Two arrays are not same!\n"+ "Expected: " + expected + "\n" + "Actual: " + actual,
    +            expected.containsAll(actual) && actual.containsAll(expected));
    --- End diff --
    
    @HeartSaVioR Do you want to address that?


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

[GitHub] storm pull request #1690: STORM-2100 Fix Trident SQL join tests to not rely ...

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

    https://github.com/apache/storm/pull/1690


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

[GitHub] storm pull request #1690: STORM-2100 Fix Trident SQL join tests to not rely ...

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

    https://github.com/apache/storm/pull/1690#discussion_r79402957
  
    --- Diff: external/sql/storm-sql-core/src/test/org/apache/storm/sql/compiler/backends/trident/TestPlanCompiler.java ---
    @@ -274,4 +276,9 @@ private void waitForCompletion(long timeout, Callable<Boolean> cond) throws Exce
           Thread.sleep(100);
         }
       }
    +
    +  private void assertArrayWithoutOrder(List<Values> expected, List<List<Object>> actual) {
    +    Assert.assertTrue("Two arrays are not same!\n"+ "Expected: " + expected + "\n" + "Actual: " + actual,
    +            expected.containsAll(actual) && actual.containsAll(expected));
    --- End diff --
    
    @HeartSaVioR You may want to check for size equality as there can be different number of equal/same elements in those collections.


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

[GitHub] storm issue #1690: STORM-2100 Fix Trident SQL join tests to not rely on orde...

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

    https://github.com/apache/storm/pull/1690
  
    Thanks @HeartSaVioR


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

[GitHub] storm pull request #1690: STORM-2100 Fix Trident SQL join tests to not rely ...

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

    https://github.com/apache/storm/pull/1690#discussion_r79529486
  
    --- Diff: external/sql/storm-sql-core/src/test/org/apache/storm/sql/compiler/backends/trident/TestPlanCompiler.java ---
    @@ -274,4 +274,9 @@ private void waitForCompletion(long timeout, Callable<Boolean> cond) throws Exce
           Thread.sleep(100);
         }
       }
    +
    +  private void assertArrayWithoutOrder(List<Values> expected, List<List<Object>> actual) {
    +    Assert.assertTrue("Two arrays are not same!\n"+ "Expected: " + expected + "\n" + "Actual: " + actual,
    --- End diff --
    
    @satishd Thanks for the detailed review. Changed to `Two lists` :) also rename the method name to represent list.


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

[GitHub] storm pull request #1690: STORM-2100 Fix Trident SQL join tests to not rely ...

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

    https://github.com/apache/storm/pull/1690#discussion_r79527079
  
    --- Diff: external/sql/storm-sql-core/src/test/org/apache/storm/sql/compiler/backends/trident/TestPlanCompiler.java ---
    @@ -274,4 +276,9 @@ private void waitForCompletion(long timeout, Callable<Boolean> cond) throws Exce
           Thread.sleep(100);
         }
       }
    +
    +  private void assertArrayWithoutOrder(List<Values> expected, List<List<Object>> actual) {
    +    Assert.assertTrue("Two arrays are not same!\n"+ "Expected: " + expected + "\n" + "Actual: " + actual,
    +            expected.containsAll(actual) && actual.containsAll(expected));
    --- End diff --
    
    @satishd Addressed via using CollectionUtils.isEqualCollection() in commons collections 4.
    
    http://commons.apache.org/proper/commons-collections/javadocs/api-release/org/apache/commons/collections4/CollectionUtils.html#isEqualCollection(java.util.Collection,%20java.util.Collection)


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

[GitHub] storm pull request #1690: STORM-2100 Fix Trident SQL join tests to not rely ...

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

    https://github.com/apache/storm/pull/1690#discussion_r79515304
  
    --- Diff: external/sql/storm-sql-core/src/test/org/apache/storm/sql/compiler/backends/trident/TestPlanCompiler.java ---
    @@ -274,4 +276,9 @@ private void waitForCompletion(long timeout, Callable<Boolean> cond) throws Exce
           Thread.sleep(100);
         }
       }
    +
    +  private void assertArrayWithoutOrder(List<Values> expected, List<List<Object>> actual) {
    +    Assert.assertTrue("Two arrays are not same!\n"+ "Expected: " + expected + "\n" + "Actual: " + actual,
    +            expected.containsAll(actual) && actual.containsAll(expected));
    --- End diff --
    
    @HeartSaVioR Sorry, I did not complete my earlier comment. Pl handle the collection equality check appropriately.


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

[GitHub] storm issue #1690: STORM-2100 Fix Trident SQL join tests to not rely on orde...

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

    https://github.com/apache/storm/pull/1690
  
    +1, once the remaining nit-pick is done.


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