You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by watermen <gi...@git.apache.org> on 2015/12/07 05:00:40 UTC

[GitHub] spark pull request: [SPARK-12167][SQL] Invoke the right sameResult...

GitHub user watermen opened a pull request:

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

    [SPARK-12167][SQL] Invoke the right sameResult function when plan is warpped with SubQueries

    ### Bug
    I find this bug when I use cache table,
    ```
    spark-sql> create table src_p(key int, value int) stored as parquet;
    OK
    Time taken: 3.144 seconds
    spark-sql> cache table src_p;
    Time taken: 1.452 seconds
    spark-sql> explain extended select count(*) from src_p;
    ```
    I got the wrong physical plan
    ```
    == Physical Plan ==
    TungstenAggregate(key=[], functions=[(count(1),mode=Final,isDistinct=false)], output=[_c0#28L])
     TungstenExchange SinglePartition
      TungstenAggregate(key=[], functions=[(count(1),mode=Partial,isDistinct=false)], output=[currentCount#33L])
       Scan ParquetRelation[hdfs://9.91.8.131:9000/user/hive/warehouse/src_p][]
    ```
    and the right physical plan is
    ```
    == Physical Plan ==
    TungstenAggregate(key=[], functions=[(count(1),mode=Final,isDistinct=false)], output=[_c0#47L])
     TungstenExchange SinglePartition
      TungstenAggregate(key=[], functions=[(count(1),mode=Partial,isDistinct=false)], output=[currentCount#62L])
       InMemoryColumnarTableScan (InMemoryRelation [key#45,value#46], true, 10000, StorageLevel(true, true, false, true, 1), (Scan ParquetRelation[hdfs://9.91.8.131:9000/user/hive/warehouse/src_p][key#9,value#10]), Some(src_p))
    ```
    ### Reason
    When the implementation classes of `MultiInstanceRelation`(eg. `LogicalRelation`, `LocalRelation`) are warpped with SubQueries, they can't invoke the right `sameResult` function in their own implementation. So we need to eliminate SubQueries first and then try to invoke `sameResult` function in their own implementation.
    Like:
    When plan is `Subquery(LogicalRelation(relation:ParquetRelation[hdfs://9.91.8.131:9000/user/hive/warehouse/src_p], expectedOutputAttributes:Some(ArrayBuffer(key#0, value#1))))`, first eliminate SubQueries, and then will invoke the `sameResult` function in `LogicalRelation` instead of `LogicalPlan`.

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

    $ git pull https://github.com/watermen/spark patch-2

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

    https://github.com/apache/spark/pull/10169.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 #10169
    
----
commit f1ef856ee4fa45bcd2143bf164dab61f6f17ce63
Author: Yadong Qi <qi...@gmail.com>
Date:   2015-12-07T03:47:05Z

    Invoke the right sameResult function when plan is warpped with SubQueries

----


---
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-12167][SQL] Invoke the right sameResult...

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

    https://github.com/apache/spark/pull/10169#issuecomment-162404057
  
    **[Test build #47250 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/47250/consoleFull)** for PR 10169 at commit [`f1ef856`](https://github.com/apache/spark/commit/f1ef856ee4fa45bcd2143bf164dab61f6f17ce63).


---
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-12167][SQL] Invoke the right sameResult...

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

    https://github.com/apache/spark/pull/10169#issuecomment-162417059
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/47250/
    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-12167][SQL] Invoke the right sameResult...

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

    https://github.com/apache/spark/pull/10169#issuecomment-162435295
  
    @dilipbiswal Yes, SPARK-11246 has already fixed it, Thanks and I'll close this 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-12167][SQL] Invoke the right sameResult...

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

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


---
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-12167][SQL] Invoke the right sameResult...

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

    https://github.com/apache/spark/pull/10169#issuecomment-162417058
  
    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-12167][SQL] Invoke the right sameResult...

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

    https://github.com/apache/spark/pull/10169#issuecomment-162407562
  
    @watermen I believe SPARK-11246 was a very similar defect and was fixed in 1.5. Is this a different scenario that what was addressed in that defect ? 
    @yhuai had suggested the fix.


---
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-12167][SQL] Invoke the right sameResult...

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

    https://github.com/apache/spark/pull/10169#issuecomment-162417004
  
    **[Test build #47250 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/47250/consoleFull)** for PR 10169 at commit [`f1ef856`](https://github.com/apache/spark/commit/f1ef856ee4fa45bcd2143bf164dab61f6f17ce63).
     * 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