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

[GitHub] spark pull request: [SPARK-12659] fix NPE in UnsafeExternalSorter ...

GitHub user davies opened a pull request:

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

    [SPARK-12659] fix NPE in UnsafeExternalSorter (used by cartesian product)

    Cartesian product use UnsafeExternalSorter without comparator to do spilling, it will NPE if spilling happens.
    
    cc @JoshRosen 

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

    $ git pull https://github.com/davies/spark fix_spilling

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

    https://github.com/apache/spark/pull/10606.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 #10606
    
----
commit ea9f01979622a6f2a8ce870555e3f5667d5f6e4c
Author: Davies Liu <da...@databricks.com>
Date:   2016-01-05T22:37:49Z

    fix NPE in cartesian product

----


---
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-12659] fix NPE in UnsafeExternalSorter ...

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

    https://github.com/apache/spark/pull/10606#issuecomment-169187237
  
    **[Test build #48793 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/48793/consoleFull)** for PR 10606 at commit [`ea9f019`](https://github.com/apache/spark/commit/ea9f01979622a6f2a8ce870555e3f5667d5f6e4c).
     * 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-12659] fix NPE in UnsafeExternalSorter ...

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

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


---
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-12659] fix NPE in UnsafeExternalSorter ...

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

    https://github.com/apache/spark/pull/10606#issuecomment-169160794
  
    **[Test build #48793 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/48793/consoleFull)** for PR 10606 at commit [`ea9f019`](https://github.com/apache/spark/commit/ea9f01979622a6f2a8ce870555e3f5667d5f6e4c).


---
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-12659] fix NPE in UnsafeExternalSorter ...

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

    https://github.com/apache/spark/pull/10606#discussion_r48919509
  
    --- Diff: core/src/main/java/org/apache/spark/util/collection/unsafe/sort/UnsafeInMemorySorter.java ---
    @@ -223,14 +227,9 @@ public void loadNext() {
        * {@code next()} will return the same mutable object.
        */
       public SortedIterator getSortedIterator() {
    -    sorter.sort(array, 0, pos / 2, sortComparator);
    -    return new SortedIterator(pos / 2);
    -  }
    -
    -  /**
    -   * Returns an iterator over record pointers in original order (inserted).
    -   */
    -  public SortedIterator getIterator() {
    +    if (sortComparator != null) {
    +      sorter.sort(array, 0, pos / 2, sortComparator);
    --- End diff --
    
    Ah. Architecturally, this is kind of confusing how we're using a sorter with no comparator as a disk-backed buffer. Have we considered making a spillable buffer that's simpler / detached from the sorting machinery?


---
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-12659] fix NPE in UnsafeExternalSorter ...

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

    https://github.com/apache/spark/pull/10606#issuecomment-169204251
  
    More comments would also be appreciated, since this is pretty confusing.


---
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-12659] fix NPE in UnsafeExternalSorter ...

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

    https://github.com/apache/spark/pull/10606#issuecomment-169187512
  
    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-12659] fix NPE in UnsafeExternalSorter ...

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

    https://github.com/apache/spark/pull/10606#discussion_r48922730
  
    --- Diff: core/src/main/java/org/apache/spark/util/collection/unsafe/sort/UnsafeInMemorySorter.java ---
    @@ -223,14 +227,9 @@ public void loadNext() {
        * {@code next()} will return the same mutable object.
        */
       public SortedIterator getSortedIterator() {
    -    sorter.sort(array, 0, pos / 2, sortComparator);
    -    return new SortedIterator(pos / 2);
    -  }
    -
    -  /**
    -   * Returns an iterator over record pointers in original order (inserted).
    -   */
    -  public SortedIterator getIterator() {
    +    if (sortComparator != null) {
    +      sorter.sort(array, 0, pos / 2, sortComparator);
    --- End diff --
    
    We could do that refactor later.


---
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-12659] fix NPE in UnsafeExternalSorter ...

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

    https://github.com/apache/spark/pull/10606#discussion_r48912881
  
    --- Diff: core/src/main/java/org/apache/spark/util/collection/unsafe/sort/UnsafeInMemorySorter.java ---
    @@ -223,14 +227,9 @@ public void loadNext() {
        * {@code next()} will return the same mutable object.
        */
       public SortedIterator getSortedIterator() {
    -    sorter.sort(array, 0, pos / 2, sortComparator);
    -    return new SortedIterator(pos / 2);
    -  }
    -
    -  /**
    -   * Returns an iterator over record pointers in original order (inserted).
    -   */
    -  public SortedIterator getIterator() {
    +    if (sortComparator != null) {
    +      sorter.sort(array, 0, pos / 2, sortComparator);
    --- End diff --
    
    No sorting is needed, only spilling is needed.


---
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-12659] fix NPE in UnsafeExternalSorter ...

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

    https://github.com/apache/spark/pull/10606#issuecomment-169203949
  
    @JoshRosen I'm merging this into master and 1.6 branch to unblock another PR, will add @Nullable in that 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-12659] fix NPE in UnsafeExternalSorter ...

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

    https://github.com/apache/spark/pull/10606#issuecomment-169187517
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/48793/
    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-12659] fix NPE in UnsafeExternalSorter ...

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

    https://github.com/apache/spark/pull/10606#discussion_r48911600
  
    --- Diff: core/src/main/java/org/apache/spark/util/collection/unsafe/sort/UnsafeInMemorySorter.java ---
    @@ -99,7 +99,11 @@ public UnsafeInMemorySorter(
         this.consumer = consumer;
         this.memoryManager = memoryManager;
         this.sorter = new Sorter<>(UnsafeSortDataFormat.INSTANCE);
    -    this.sortComparator = new SortComparator(recordComparator, prefixComparator, memoryManager);
    +    if (recordComparator != null) {
    --- End diff --
    
    `recordComparator` is nullable? That's surprising to me. If `recordComparator` is null, does that also imply that `prefixComparator` is null? Can we put `@Nullable` annotations on the parameter so that IntelliJ's fancy nullability handling checks work properly?


---
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-12659] fix NPE in UnsafeExternalSorter ...

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

    https://github.com/apache/spark/pull/10606#discussion_r48911664
  
    --- Diff: core/src/main/java/org/apache/spark/util/collection/unsafe/sort/UnsafeInMemorySorter.java ---
    @@ -223,14 +227,9 @@ public void loadNext() {
        * {@code next()} will return the same mutable object.
        */
       public SortedIterator getSortedIterator() {
    -    sorter.sort(array, 0, pos / 2, sortComparator);
    -    return new SortedIterator(pos / 2);
    -  }
    -
    -  /**
    -   * Returns an iterator over record pointers in original order (inserted).
    -   */
    -  public SortedIterator getIterator() {
    +    if (sortComparator != null) {
    +      sorter.sort(array, 0, pos / 2, sortComparator);
    --- End diff --
    
    If `sortComparator == null`, does that imply that the input array was already 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