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

[GitHub] spark pull request: [SPARK-15135][SQL]Make sure SparkSession threa...

GitHub user zsxwing opened a pull request:

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

    [SPARK-15135][SQL]Make sure SparkSession thread safe

    ## What changes were proposed in this pull request?
    
    Went through SparkSession and its members and fixed non-thread-safe classes used by SparkSession
    
    ## How was this patch tested?
    
    Existing unit tests

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

    $ git pull https://github.com/zsxwing/spark spark-session-thread-safe

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

    https://github.com/apache/spark/pull/12915.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 #12915
    
----
commit 963f0432e18138299eadb429f04ed22da0abd756
Author: Shixiong Zhu <sh...@databricks.com>
Date:   2016-05-04T22:04:57Z

    Make sure SparkSession thread safe
    
    Went through SparkSession and its members and fixed non-thread-safe classes used by SparkSession

----


---
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-15135][SQL]Make sure SparkSession threa...

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

    https://github.com/apache/spark/pull/12915#issuecomment-217045886
  
    **[Test build #57823 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/57823/consoleFull)** for PR 12915 at commit [`b3e7e76`](https://github.com/apache/spark/commit/b3e7e76cfb3c3d227a23eff0bd332b5b50d4b5a4).


---
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-15135][SQL]Make sure SparkSession threa...

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

    https://github.com/apache/spark/pull/12915#issuecomment-217042592
  
    Test FAILed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/57817/
    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-15135][SQL]Make sure SparkSession threa...

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

    https://github.com/apache/spark/pull/12915#issuecomment-217037790
  
    **[Test build #57817 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/57817/consoleFull)** for PR 12915 at commit [`7850cbe`](https://github.com/apache/spark/commit/7850cbe511cd3860d080dd7e9036ed64a83722d2).


---
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-15135][SQL]Make sure SparkSession threa...

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

    https://github.com/apache/spark/pull/12915#discussion_r62265808
  
    --- Diff: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/catalog/SessionCatalog.scala ---
    @@ -330,19 +334,21 @@ class SessionCatalog(
        * the same name, then, if that does not exist, return the table from the current database.
        */
       def lookupRelation(name: TableIdentifier, alias: Option[String] = None): LogicalPlan = {
    -    val db = name.database.getOrElse(currentDb)
    -    val table = formatTableName(name.table)
    -    val relation =
    -      if (name.database.isDefined || !tempTables.contains(table)) {
    -        val metadata = externalCatalog.getTable(db, table)
    -        SimpleCatalogRelation(db, metadata, alias)
    -      } else {
    -        tempTables(table)
    -      }
    -    val qualifiedTable = SubqueryAlias(table, relation)
    -    // If an alias was specified by the lookup, wrap the plan in a subquery so that
    -    // attributes are properly qualified with this alias.
    -    alias.map(a => SubqueryAlias(a, qualifiedTable)).getOrElse(qualifiedTable)
    +    synchronized {
    +      val db = name.database.getOrElse(currentDb)
    +      val table = formatTableName(name.table)
    +      val relation =
    +        if (name.database.isDefined || !tempTables.contains(table)) {
    +          val metadata = externalCatalog.getTable(db, table)
    +          SimpleCatalogRelation(db, metadata, alias)
    +        } else {
    +          tempTables(table)
    +        }
    +      val qualifiedTable = SubqueryAlias(table, relation)
    --- End diff --
    
    nit: look like this call and alias.map() can be outside the synchronized block.


---
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-15135][SQL]Make sure SparkSession threa...

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

    https://github.com/apache/spark/pull/12915#issuecomment-217040415
  
    Looks good


---
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-15135][SQL]Make sure SparkSession threa...

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

    https://github.com/apache/spark/pull/12915#issuecomment-217287150
  
    Merging into master 2.0.


---
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-15135][SQL]Make sure SparkSession threa...

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

    https://github.com/apache/spark/pull/12915#issuecomment-217042589
  
    Merged build finished. 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-15135][SQL]Make sure SparkSession threa...

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

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


---
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-15135][SQL]Make sure SparkSession threa...

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

    https://github.com/apache/spark/pull/12915#issuecomment-217042565
  
    **[Test build #57817 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/57817/consoleFull)** for PR 12915 at commit [`7850cbe`](https://github.com/apache/spark/commit/7850cbe511cd3860d080dd7e9036ed64a83722d2).
     * 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-15135][SQL]Make sure SparkSession threa...

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

    https://github.com/apache/spark/pull/12915#issuecomment-217056789
  
    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-15135][SQL]Make sure SparkSession threa...

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

    https://github.com/apache/spark/pull/12915#issuecomment-217056682
  
    **[Test build #57823 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/57823/consoleFull)** for PR 12915 at commit [`b3e7e76`](https://github.com/apache/spark/commit/b3e7e76cfb3c3d227a23eff0bd332b5b50d4b5a4).
     * 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-15135][SQL]Make sure SparkSession threa...

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

    https://github.com/apache/spark/pull/12915#issuecomment-217056790
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/57823/
    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