You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by yanbohappy <gi...@git.apache.org> on 2014/12/29 10:43:28 UTC

[GitHub] spark pull request: HiveTableScan return mutable row with copy

GitHub user yanbohappy opened a pull request:

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

    HiveTableScan return mutable row with copy

    https://issues.apache.org/jira/browse/SPARK-4963
    SchemaRDD.sample() return wrong results due to GapSamplingIterator operating on mutable row.
    HiveTableScan make RDD with SpecificMutableRow and SchemaRDD.sample() will return GapSamplingIterator for iterating. 
    
    override def next(): T = {
        val r = data.next()
        advance
        r
      }
    
    GapSamplingIterator.next() return the current underlying element and assigned it to r.
    However if the underlying iterator is mutable row just like what HiveTableScan returned, underlying iterator and r will point to the same object.
    After advance operation, we drop some underlying elments and it also changed r which is not expected. Then we return the wrong value different from initial r.
    
    To fix this issue, the most direct way is to make HiveTableScan return mutable row with copy just like the initial commit that I have made. This solution will make HiveTableScan can not get the full advantage of reusable MutableRow, but it can make sample operation return correct result.
    Further more, we need to investigate  GapSamplingIterator.next() and make it can implement copy operation inside it. To achieve this, we should define every elements that RDD can store implement the function like cloneable and it will make huge change.


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

    $ git pull https://github.com/yanbohappy/spark spark-4963

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

    https://github.com/apache/spark/pull/3827.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 #3827
    
----
commit 6eaee5e7b1b5aca7f6abd16892f8312c7d6d7917
Author: Yanbo Liang <ya...@gmail.com>
Date:   2014-12-29T09:00:44Z

    HiveTableScan return mutable row with copy

----


---
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-4963 [SQL] Add copy to SQL's Sample oper...

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

    https://github.com/apache/spark/pull/3827#issuecomment-68429063
  
      [Test build #24947 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/24947/consoleFull) for   PR 3827 at commit [`65c4e7c`](https://github.com/apache/spark/commit/65c4e7cdb906412abc154bb25cdfd49b6d53e9f9).
     * 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-4963 [SQL] Add copy to SQL's Sample oper...

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

    https://github.com/apache/spark/pull/3827#issuecomment-69291900
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/25293/
    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-4963 [SQL] HiveTableScan return mutable ...

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

    https://github.com/apache/spark/pull/3827#issuecomment-68329556
  
    Hey @yanbohappy, as I've commented in the JIRA, would you mind to do a micro benchmark using code in #758 to see whether this fix introduces noticeable performance regression?


---
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-4963 [SQL] Add copy to SQL's Sample oper...

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

    https://github.com/apache/spark/pull/3827#issuecomment-68429064
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/24947/
    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-4963 [SQL] Add copy to SQL's Sample oper...

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

    https://github.com/apache/spark/pull/3827#discussion_r22762347
  
    --- Diff: sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/SQLQuerySuite.scala ---
    @@ -195,4 +196,19 @@ class SQLQuerySuite extends QueryTest {
         checkAnswer(sql("SELECT sum( distinct key) FROM src group by key order by key"),
           sql("SELECT distinct key FROM src order by key").collect().toSeq)
       }
    +
    +  test("SPARK-4963 SchemaRDD sample on mutable row return wrong result") {
    +    sql("CREATE TABLE IF NOT EXISTS src (key INT, value STRING)")
    +    val location =
    +      Utils.getSparkClassLoader.getResource("data/files/kv1.txt").getFile()
    +    sql(s"LOAD DATA LOCAL INPATH '$location' INTO TABLE src")
    --- End diff --
    
    You don't need to create the `src` table.  Our test harness does that automatically whenever the test tables are referenced.  I can remove this when merging.


---
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-4963 [SQL] Add copy to SQL's Sample oper...

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

    https://github.com/apache/spark/pull/3827#issuecomment-68425791
  
      [Test build #24942 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/24942/consoleFull) for   PR 3827 at commit [`55c7c56`](https://github.com/apache/spark/commit/55c7c5610691d0e9097c859dda3e54fe295b3782).
     * This patch **fails Spark unit 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-4963 [SQL] HiveTableScan return mutable ...

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

    https://github.com/apache/spark/pull/3827#issuecomment-68294823
  
      [Test build #24866 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/24866/consoleFull) for   PR 3827 at commit [`6eaee5e`](https://github.com/apache/spark/commit/6eaee5e7b1b5aca7f6abd16892f8312c7d6d7917).
     * This patch merges cleanly.


---
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-4963 [SQL] Add copy to SQL's Sample oper...

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

    https://github.com/apache/spark/pull/3827#issuecomment-69291894
  
      [Test build #25293 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/25293/consoleFull) for   PR 3827 at commit [`0912ca0`](https://github.com/apache/spark/commit/0912ca0fbbe6195e9753c78a86a2c40a0699e182).
     * 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-4963 [SQL] HiveTableScan return mutable ...

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

    https://github.com/apache/spark/pull/3827#issuecomment-68329848
  
    @yanbohappy Actually, we can move the `copy` call to [`execution.Sample.execute`] [1]. In this way, queries without sampling are not negatively effected.
    
    [1]: https://github.com/apache/spark/blob/master/sql/core/src/main/scala/org/apache/spark/sql/execution/basicOperators.scala#L73


---
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-4963 [SQL] HiveTableScan return mutable ...

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

    https://github.com/apache/spark/pull/3827#issuecomment-68337920
  
      [Test build #24888 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/24888/consoleFull) for   PR 3827 at commit [`cea7e2e`](https://github.com/apache/spark/commit/cea7e2ec42c44f81965f8adf462faa887e2dae89).
     * This patch merges cleanly.


---
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-4963 [SQL] Add copy to SQL's Sample oper...

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

    https://github.com/apache/spark/pull/3827#issuecomment-68425407
  
      [Test build #24942 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/24942/consoleFull) for   PR 3827 at commit [`55c7c56`](https://github.com/apache/spark/commit/55c7c5610691d0e9097c859dda3e54fe295b3782).
     * This patch merges cleanly.


---
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-4963 [SQL] Add copy to SQL's Sample oper...

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

    https://github.com/apache/spark/pull/3827#issuecomment-68341428
  
      [Test build #24888 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/24888/consoleFull) for   PR 3827 at commit [`cea7e2e`](https://github.com/apache/spark/commit/cea7e2ec42c44f81965f8adf462faa887e2dae89).
     * 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-4963 [SQL] Add copy to SQL's Sample oper...

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

    https://github.com/apache/spark/pull/3827#issuecomment-68425561
  
    Change for better test output and move it to another test file which is more reasonable.


---
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-4963 [SQL] HiveTableScan return mutable ...

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

    https://github.com/apache/spark/pull/3827#issuecomment-68294587
  
    ok to test


---
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-4963 [SQL] Add copy to SQL's Sample oper...

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

    https://github.com/apache/spark/pull/3827#issuecomment-68341432
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/24888/
    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-4963 [SQL] Add copy to SQL's Sample oper...

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

    https://github.com/apache/spark/pull/3827#issuecomment-69160371
  
    Can anyone verify and merge this patch? It's a bug appeared frequently and fix it asap will be better.


---
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-4963 [SQL] HiveTableScan return mutable ...

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

    https://github.com/apache/spark/pull/3827#issuecomment-68301617
  
      [Test build #24866 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/24866/consoleFull) for   PR 3827 at commit [`6eaee5e`](https://github.com/apache/spark/commit/6eaee5e7b1b5aca7f6abd16892f8312c7d6d7917).
     * 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-4963 [SQL] Add copy to SQL's Sample oper...

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

    https://github.com/apache/spark/pull/3827#issuecomment-69288276
  
      [Test build #25293 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/25293/consoleFull) for   PR 3827 at commit [`0912ca0`](https://github.com/apache/spark/commit/0912ca0fbbe6195e9753c78a86a2c40a0699e182).
     * This patch merges cleanly.


---
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-4963 [SQL] Add copy to SQL's Sample oper...

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

    https://github.com/apache/spark/pull/3827#issuecomment-68425797
  
    Test FAILed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/24942/
    Test FAILed.


---
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-4963 [SQL] HiveTableScan return mutable ...

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

    https://github.com/apache/spark/pull/3827#issuecomment-68301622
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/24866/
    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-4963 [SQL] Add copy to SQL's Sample oper...

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

    https://github.com/apache/spark/pull/3827#issuecomment-68426906
  
      [Test build #24947 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/24947/consoleFull) for   PR 3827 at commit [`65c4e7c`](https://github.com/apache/spark/commit/65c4e7cdb906412abc154bb25cdfd49b6d53e9f9).
     * This patch merges cleanly.


---
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-4963 [SQL] HiveTableScan return mutable ...

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

    https://github.com/apache/spark/pull/3827#issuecomment-68294581
  
    add to whitelist


---
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-4963 [SQL] Add copy to SQL's Sample oper...

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

    https://github.com/apache/spark/pull/3827#issuecomment-69172458
  
    Sorry for the late response. This LGTM except a minor styling issue. 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-4963 [SQL] HiveTableScan return mutable ...

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

    https://github.com/apache/spark/pull/3827#issuecomment-68244170
  
    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-4963 [SQL] HiveTableScan return mutable ...

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

    https://github.com/apache/spark/pull/3827#issuecomment-68339079
  
    @liancheng I agree to move the copy call to execution.Sample.execute and added new commits.
    It will take no effect on HiveTableScan.


---
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-4963 [SQL] Add copy to SQL's Sample oper...

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

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


---
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-4963 [SQL] Add copy to SQL's Sample oper...

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

    https://github.com/apache/spark/pull/3827#issuecomment-69474520
  
    Thanks!  I've merged this to master.


---
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-4963 [SQL] Add copy to SQL's Sample oper...

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

    https://github.com/apache/spark/pull/3827#discussion_r22648661
  
    --- Diff: sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/SQLQuerySuite.scala ---
    @@ -195,4 +196,19 @@ class SQLQuerySuite extends QueryTest {
         checkAnswer(sql("SELECT sum( distinct key) FROM src group by key order by key"),
           sql("SELECT distinct key FROM src order by key").collect().toSeq)
       }
    +
    +  test("SPARK-4963 SchemaRDD sample on mutable row return wrong result") {
    +    sql("CREATE TABLE IF NOT EXISTS src (key INT, value STRING)")
    +    val location =
    +      Utils.getSparkClassLoader.getResource("data/files/kv1.txt").getFile()
    +    sql(s"LOAD DATA LOCAL INPATH '$location' INTO TABLE src")
    +    sql("SELECT * FROM src WHERE key % 2 = 0")
    +      .sample(withReplacement = false, fraction = 0.3)
    +      .registerTempTable("sampled")
    +    (1 to 10).foreach{ i =>
    --- End diff --
    
    Nit: space before `{`.


---
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-4963 [SQL] Add copy to SQL's Sample oper...

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

    https://github.com/apache/spark/pull/3827#discussion_r22360456
  
    --- Diff: sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/HiveTableScanSuite.scala ---
    @@ -76,4 +76,19 @@ class HiveTableScanSuite extends HiveComparisonTest {
           === Array(Row(java.sql.Timestamp.valueOf("2014-12-11 00:00:00")),Row(null)))
         TestHive.sql("DROP TABLE timestamp_query_null")
       }
    +
    +  test("Spark-4963: SchemaRDD sample on mutable row return wrong result") {
    +    TestHive.sql("CREATE TABLE IF NOT EXISTS src (key INT, value STRING)")
    +    val location =
    +      Utils.getSparkClassLoader.getResource("data/files/kv1.txt").getFile()
    +    TestHive.sql(s"LOAD DATA LOCAL INPATH '$location' INTO TABLE src")
    +    TestHive.sql("SELECT * FROM src WHERE key % 2 = 0")
    +      .sample(withReplacement = false, fraction = 0.3)
    +      .registerTempTable("sampled")
    +    assert((1 to 10)
    --- End diff --
    
    Use `checkAnswer` instead here as it give better output when there is an exception or the answer is wrong.
    
    ```scala
    (1 to 10).foreach { i =>
      checkAnswer(
        sql("SELECT * FROM sampled WHERE key % 2 = 1"),
        Seq.empty)
    }
    ```


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