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

[GitHub] spark pull request: [SPARK-6748] [SQL] Makes QueryPlan.schema a la...

GitHub user liancheng opened a pull request:

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

    [SPARK-6748] [SQL] Makes QueryPlan.schema a lazy val

    `DataFrame.collect()` calls `SparkPlan.executeCollect()`, which consists of a single line:
    
    ```scala
    execute().map(ScalaReflection.convertRowToScala(_, schema)).collect()
    ```
    
    The problem is that, `QueryPlan.schema` is a function. And since 1.3.0, `convertRowToScala` starts returning a `GenericRowWithSchema`. Thus, every `GenericRowWithSchema` instance holds a separate copy of the schema object. Also, YJP profiling result of the following simple micro benchmark (executed in Spark shell) shows that constructing the schema object takes up to ~35% CPU time.
    
    ```scala
    sc.parallelize(1 to 10000000).
      map(i => (i, s"val_$i")).
      toDF("key", "value").
      saveAsParquetFile("file:///tmp/src.parquet")
    
    // Profiling started from this line
    sqlContext.parquetFile("file:///tmp/src.parquet").collect()
    ```

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

    $ git pull https://github.com/liancheng/spark spark-6748

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

    https://github.com/apache/spark/pull/5398.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 #5398
    
----
commit 31594692005d0f4802354f973d438d5b95b7c79a
Author: Cheng Lian <li...@databricks.com>
Date:   2015-04-07T17:40:22Z

    Makes QueryPlan.schema a lazy val

----


---
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-6748] [SQL] Makes QueryPlan.schema a la...

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

    https://github.com/apache/spark/pull/5398#issuecomment-90763942
  
    Merged 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-6748] [SQL] Makes QueryPlan.schema a la...

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

    https://github.com/apache/spark/pull/5398#issuecomment-90679626
  
      [Test build #29804 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/29804/consoleFull) for   PR 5398 at commit [`3159469`](https://github.com/apache/spark/commit/31594692005d0f4802354f973d438d5b95b7c79a).


---
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-6748] [SQL] Makes QueryPlan.schema a la...

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

    https://github.com/apache/spark/pull/5398#issuecomment-90707259
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/29804/
    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-6748] [SQL] Makes QueryPlan.schema a la...

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

    https://github.com/apache/spark/pull/5398#issuecomment-90707243
  
      [Test build #29804 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/29804/consoleFull) for   PR 5398 at commit [`3159469`](https://github.com/apache/spark/commit/31594692005d0f4802354f973d438d5b95b7c79a).
     * This patch **passes all tests**.
     * This patch merges cleanly.
     * This patch adds no public classes.
     * This patch does not change any dependencies.


---
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-6748] [SQL] Makes QueryPlan.schema a la...

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

    https://github.com/apache/spark/pull/5398#issuecomment-90687999
  
    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-6748] [SQL] Makes QueryPlan.schema a la...

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

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


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