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

[GitHub] spark pull request: [Spark-15236][SQL][SPARK SHELL] Add spark-defa...

GitHub user xwu0226 opened a pull request:

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

    [Spark-15236][SQL][SPARK SHELL] Add spark-defaults property to switch to use InMemoryCatalog

    ## What changes were proposed in this pull request?
    1. Add property `spark.user.hive.catalog ` in the spark-defaults.conf.template 
    2. Change REPL/Main to check this property to decide if `enableHiveSupport `should be called. 
    
    ## How was this patch tested?
    Run the REPL component test. 


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

    $ git pull https://github.com/xwu0226/spark SPARK-15236

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

    https://github.com/apache/spark/pull/13088.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 #13088
    
----
commit ef5944949f362a5f4846b218f18d5ceab7853349
Author: xin Wu <xi...@us.ibm.com>
Date:   2016-05-08T07:06:36Z

    spark-15206 add testcases for distinct aggregate in having clause following up PR12974

commit 5f55a1a54099668c82b5404c2929b36ac88cd34b
Author: xin Wu <xi...@us.ibm.com>
Date:   2016-05-08T07:09:44Z

    Revert "spark-15206 add testcases for distinct aggregate in having clause following up PR12974"
    
    This reverts commit 98a1f804d7343ba77731f9aa400c00f1a26c03fe.

commit 74c65dbeb60cda3b2aade493542eed4470a6143c
Author: xin Wu <xi...@us.ibm.com>
Date:   2016-05-13T01:40:37Z

    SPARK-15236: add a spark-defaults.conf property  to control whehter REPL will use Hive catalog or not

----


---
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-15236][SQL][SPARK SHELL] Add spark-defa...

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

    https://github.com/apache/spark/pull/13088#discussion_r63133610
  
    --- Diff: repl/scala-2.11/src/main/scala/org/apache/spark/repl/Main.scala ---
    @@ -88,7 +88,8 @@ object Main extends Logging {
         }
     
         val builder = SparkSession.builder.config(conf)
    -    if (SparkSession.hiveClassesArePresent) {
    +    if (conf.getBoolean("spark.user.hive.catalog", true)
    --- End diff --
    
    why do we need this? isn't the enableHiveSupport the same as setting a config spark.sql.catalogImplementation


---
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-15236][SQL][SPARK SHELL] Add spark-defa...

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

    https://github.com/apache/spark/pull/13088#issuecomment-221925644
  
    **[Test build #59390 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/59390/consoleFull)** for PR 13088 at commit [`9c3bd5a`](https://github.com/apache/spark/commit/9c3bd5aab9a12339e0957706cfe8671c040c4c43).


---
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-15236][SQL][SPARK SHELL] Add spark-defa...

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

    https://github.com/apache/spark/pull/13088#issuecomment-222056125
  
    **[Test build #59448 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/59448/consoleFull)** for PR 13088 at commit [`ed6058f`](https://github.com/apache/spark/commit/ed6058f8b473a4ea0f82ee010d7468ad5ca54efb).
     * 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-15236][SQL][SPARK SHELL] Add spark-defa...

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

    https://github.com/apache/spark/pull/13088#issuecomment-221948560
  
    Test FAILed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/59390/
    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-15236][SQL][SPARK SHELL] Add spark-defa...

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

    https://github.com/apache/spark/pull/13088#issuecomment-222042825
  
    @andrewor14 I refined the code based on the review comments. Please help check again! Thank you very much!


---
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-15236][SQL][SPARK SHELL] Add spark-defa...

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

    https://github.com/apache/spark/pull/13088#issuecomment-221968007
  
    @xwu0226 thanks for working on this. This patch currently exposes too much to the user. The config is internal and should be kept that way; that's the reason why it's not documented.


---
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-15236][SQL][SPARK SHELL] Add spark-defaults prope...

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

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


---
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-15236][SQL][SPARK SHELL] Add spark-defa...

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

    https://github.com/apache/spark/pull/13088#discussion_r64804173
  
    --- Diff: repl/scala-2.11/src/main/scala/org/apache/spark/repl/SparkILoop.scala ---
    @@ -43,6 +43,10 @@ class SparkILoop(in0: Option[BufferedReader], out: JPrintWriter)
               println("Spark context available as 'sc' " +
                 s"(master = ${_sc.master}, app id = ${_sc.applicationId}).")
               println("Spark session available as 'spark'.")
    +          spark.usingHive match {
    +            case true => println("Spark session is using Hive catalog.")
    +            case _ => println("Spark session is using in-memory catalog.")
    +          }
    --- End diff --
    
    I think it's better to not log this here


---
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-15236][SQL][SPARK SHELL] Add spark-defaults prope...

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

    https://github.com/apache/spark/pull/13088
  
    @andrewor14 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-15236][SQL][SPARK SHELL] Add spark-defa...

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

    https://github.com/apache/spark/pull/13088#issuecomment-221948556
  
    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-15236][SQL][SPARK SHELL] Add spark-defaults prope...

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

    https://github.com/apache/spark/pull/13088
  
    **[Test build #59688 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/59688/consoleFull)** for PR 13088 at commit [`6b41420`](https://github.com/apache/spark/commit/6b414205962ecf7eecc13a990f1946b2d988bae0).


---
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-15236][SQL][SPARK SHELL] Add spark-defa...

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

    https://github.com/apache/spark/pull/13088#discussion_r64803716
  
    --- Diff: repl/scala-2.11/src/main/scala/org/apache/spark/repl/Main.scala ---
    @@ -88,10 +88,22 @@ object Main extends Logging {
         }
     
         val builder = SparkSession.builder.config(conf)
    -    if (SparkSession.hiveClassesArePresent) {
    -      sparkSession = builder.enableHiveSupport().getOrCreate()
    -      logInfo("Created Spark session with Hive support")
    +    if (conf.get("spark.sql.catalogImplementation", "hive").toLowerCase == "hive") {
    --- End diff --
    
    can you use `conf.get(CATALOG_IMPLEMENTATION)` here?


---
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-15236][SQL][SPARK SHELL] Add spark-defaults prope...

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

    https://github.com/apache/spark/pull/13088#discussion_r65266515
  
    --- Diff: repl/scala-2.11/src/main/scala/org/apache/spark/repl/Main.scala ---
    @@ -88,12 +89,25 @@ object Main extends Logging {
         }
     
         val builder = SparkSession.builder.config(conf)
    -    if (SparkSession.hiveClassesArePresent) {
    -      sparkSession = builder.enableHiveSupport().getOrCreate()
    -      logInfo("Created Spark session with Hive support")
    +    if (conf.get(CATALOG_IMPLEMENTATION.key, "hive").toLowerCase == "hive") {
    +      if (SparkSession.hiveClassesArePresent) {
    +        // In the case that the property is not set at all, builder's config
    +        // does not have this value set to 'hive' yet. The original default
    +        // behavior is that when there are hive classes, we use hive catalog.
    +        sparkSession = builder.enableHiveSupport().getOrCreate()
    +        logInfo("Created Spark session with Hive catalog")
    --- End diff --
    
    Hive catalog is something else so this message might be confusing. I would just say with Hive support


---
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-15236][SQL][SPARK SHELL] Add spark-defa...

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

    https://github.com/apache/spark/pull/13088#discussion_r64804303
  
    --- Diff: conf/spark-defaults.conf.template ---
    @@ -25,3 +25,4 @@
     # spark.serializer                 org.apache.spark.serializer.KryoSerializer
     # spark.driver.memory              5g
     # spark.executor.extraJavaOptions  -XX:+PrintGCDetails -Dkey=value -Dnumbers="one two three"
    +# spark.sql.catalogImplementation  hive
    --- End diff --
    
    I also wouldn't document this here. This config is largely meant to be for internal use.


---
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-15236][SQL][SPARK SHELL] Add spark-defaults prope...

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

    https://github.com/apache/spark/pull/13088
  
    **[Test build #59688 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/59688/consoleFull)** for PR 13088 at commit [`6b41420`](https://github.com/apache/spark/commit/6b414205962ecf7eecc13a990f1946b2d988bae0).
     * 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-15236][SQL][SPARK SHELL] Add spark-defa...

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

    https://github.com/apache/spark/pull/13088#discussion_r64811898
  
    --- Diff: repl/scala-2.11/src/main/scala/org/apache/spark/repl/SparkILoop.scala ---
    @@ -43,6 +43,10 @@ class SparkILoop(in0: Option[BufferedReader], out: JPrintWriter)
               println("Spark context available as 'sc' " +
                 s"(master = ${_sc.master}, app id = ${_sc.applicationId}).")
               println("Spark session available as 'spark'.")
    +          spark.usingHive match {
    +            case true => println("Spark session is using Hive catalog.")
    +            case _ => println("Spark session is using in-memory catalog.")
    +          }
    --- End diff --
    
    So we don't want to disclose on the spark shell starting console whether we are using Hive Catalog or In-memory catalog at all? I can remove it, then. 


---
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-15236][SQL][SPARK SHELL] Add spark-defa...

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

    https://github.com/apache/spark/pull/13088#discussion_r64803892
  
    --- Diff: sql/core/src/main/scala/org/apache/spark/sql/SparkSession.scala ---
    @@ -585,6 +585,18 @@ class SparkSession private(
         sparkContext.stop()
       }
     
    +  /**
    +   * Return whether the SparkSession is using hive catalog or not
    +   * @return
    +   * @since 2.0.0
    +   */
    +  def usingHive: Boolean = {
    --- End diff --
    
    I don't think we want this API, can you remove it?


---
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-15236][SQL][SPARK SHELL] Add spark-defa...

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

    https://github.com/apache/spark/pull/13088#discussion_r63134583
  
    --- Diff: repl/scala-2.11/src/main/scala/org/apache/spark/repl/Main.scala ---
    @@ -88,7 +88,8 @@ object Main extends Logging {
         }
     
         val builder = SparkSession.builder.config(conf)
    -    if (SparkSession.hiveClassesArePresent) {
    +    if (conf.getBoolean("spark.user.hive.catalog", true)
    --- End diff --
    
    Right now from the repl/Main.scala level, the way to generate a sparkSession with hive catalog is checking `SparkSession.hiveClassesArePresent`, which checks for the classes for `HiveSharedState` and `HiveSessionState`.  If these classes are built, repl will always start sparkSession that uses hive catalog.  In order for repl to use InMemoryCatalog, we need to go the else code path of the code 
    ```
    if (conf.getBoolean("spark.use.hive.catalog", true)
          && SparkSession.hiveClassesArePresent) {
          sparkSession = builder.enableHiveSupport().getOrCreate()
          logInfo("Created Spark session with Hive support")
        } else {
          sparkSession = builder.getOrCreate()
          logInfo("Created Spark session")
        }
    ```
    I think the default value for the `CATALOG_IMPLEMENTATION` is `in-memory`. But maybe I can put this key `spark.sql.catalogImplementation` in the spark-defaults.conf ?
    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-15236][SQL][SPARK SHELL] Add spark-defa...

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

    https://github.com/apache/spark/pull/13088#issuecomment-221950494
  
    Let me rebase and try again.


---
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-15236][SQL][SPARK SHELL] Add spark-defa...

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

    https://github.com/apache/spark/pull/13088#issuecomment-222056226
  
    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-15236][SQL][SPARK SHELL] Add spark-defa...

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

    https://github.com/apache/spark/pull/13088#discussion_r64812131
  
    --- Diff: sql/core/src/main/scala/org/apache/spark/sql/SparkSession.scala ---
    @@ -585,6 +585,18 @@ class SparkSession private(
         sparkContext.stop()
       }
     
    +  /**
    +   * Return whether the SparkSession is using hive catalog or not
    +   * @return
    +   * @since 2.0.0
    +   */
    +  def usingHive: Boolean = {
    --- End diff --
    
    I can remove it because SparkILooop will not use it to display whether we are using hive catalog. 


---
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-15236][SQL][SPARK SHELL] Add spark-defa...

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

    https://github.com/apache/spark/pull/13088#issuecomment-221788192
  
    @rxin @andrewor14 @cloud-fan Please help review! 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-15236][SQL][SPARK SHELL] Add spark-defa...

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

    https://github.com/apache/spark/pull/13088#issuecomment-221924482
  
    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-15236][SQL][SPARK SHELL] Add spark-defa...

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

    https://github.com/apache/spark/pull/13088#discussion_r64811522
  
    --- Diff: repl/scala-2.11/src/main/scala/org/apache/spark/repl/Main.scala ---
    @@ -88,10 +88,22 @@ object Main extends Logging {
         }
     
         val builder = SparkSession.builder.config(conf)
    -    if (SparkSession.hiveClassesArePresent) {
    -      sparkSession = builder.enableHiveSupport().getOrCreate()
    -      logInfo("Created Spark session with Hive support")
    +    if (conf.get("spark.sql.catalogImplementation", "hive").toLowerCase == "hive") {
    +      if (SparkSession.hiveClassesArePresent) {
    +        // In the case that the property is not set at all, builder's config
    +        // does not have this value set to 'hive' yet. The original default
    +        // behavior is that when there are hive classes, we use hive catalog.
    +        sparkSession = builder.enableHiveSupport().getOrCreate()
    +        logInfo("Created Spark session with Hive support")
    +      } else {
    +        // Need to change it back to 'in-memory' if no hive classes are found
    +        // in the case that the property is set to hive in spark-defaults.conf
    +        builder.config("spark.sql.catalogImplementation", "in-memory")
    --- End diff --
    
    Yes. Will use this key.


---
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-15236][SQL][SPARK SHELL] Add spark-defa...

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

    https://github.com/apache/spark/pull/13088#discussion_r64803748
  
    --- Diff: repl/scala-2.11/src/main/scala/org/apache/spark/repl/Main.scala ---
    @@ -88,10 +88,22 @@ object Main extends Logging {
         }
     
         val builder = SparkSession.builder.config(conf)
    -    if (SparkSession.hiveClassesArePresent) {
    -      sparkSession = builder.enableHiveSupport().getOrCreate()
    -      logInfo("Created Spark session with Hive support")
    +    if (conf.get("spark.sql.catalogImplementation", "hive").toLowerCase == "hive") {
    +      if (SparkSession.hiveClassesArePresent) {
    +        // In the case that the property is not set at all, builder's config
    +        // does not have this value set to 'hive' yet. The original default
    +        // behavior is that when there are hive classes, we use hive catalog.
    +        sparkSession = builder.enableHiveSupport().getOrCreate()
    +        logInfo("Created Spark session with Hive support")
    +      } else {
    +        // Need to change it back to 'in-memory' if no hive classes are found
    +        // in the case that the property is set to hive in spark-defaults.conf
    +        builder.config("spark.sql.catalogImplementation", "in-memory")
    --- End diff --
    
    `CATALOG_IMPLEMENTATION.key`


---
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-15236][SQL][SPARK SHELL] Add spark-defaults prope...

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

    https://github.com/apache/spark/pull/13088#discussion_r65266575
  
    --- Diff: repl/scala-2.11/src/main/scala/org/apache/spark/repl/Main.scala ---
    @@ -88,12 +89,25 @@ object Main extends Logging {
         }
     
         val builder = SparkSession.builder.config(conf)
    -    if (SparkSession.hiveClassesArePresent) {
    -      sparkSession = builder.enableHiveSupport().getOrCreate()
    -      logInfo("Created Spark session with Hive support")
    +    if (conf.get(CATALOG_IMPLEMENTATION.key, "hive").toLowerCase == "hive") {
    +      if (SparkSession.hiveClassesArePresent) {
    +        // In the case that the property is not set at all, builder's config
    +        // does not have this value set to 'hive' yet. The original default
    +        // behavior is that when there are hive classes, we use hive catalog.
    +        sparkSession = builder.enableHiveSupport().getOrCreate()
    +        logInfo("Created Spark session with Hive catalog")
    +      } else {
    +        // Need to change it back to 'in-memory' if no hive classes are found
    +        // in the case that the property is set to hive in spark-defaults.conf
    +        builder.config(CATALOG_IMPLEMENTATION.key, "in-memory")
    +        sparkSession = builder.getOrCreate()
    +        logInfo("Created Spark session with in-memory catalog")
    --- End diff --
    
    this is still exposing too much; the in-memory catalog is a detail the user shouldn't worry about. I would just say `Created Spark session` here


---
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-15236][SQL][SPARK SHELL] Add spark-defa...

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

    https://github.com/apache/spark/pull/13088#discussion_r64812164
  
    --- Diff: conf/spark-defaults.conf.template ---
    @@ -25,3 +25,4 @@
     # spark.serializer                 org.apache.spark.serializer.KryoSerializer
     # spark.driver.memory              5g
     # spark.executor.extraJavaOptions  -XX:+PrintGCDetails -Dkey=value -Dnumbers="one two three"
    +# spark.sql.catalogImplementation  hive
    --- End diff --
    
    Ok. will remove it.


---
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-15236][SQL][SPARK SHELL] Add spark-defa...

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

    https://github.com/apache/spark/pull/13088#issuecomment-218933252
  
    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-15236][SQL][SPARK SHELL] Add spark-defa...

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

    https://github.com/apache/spark/pull/13088#issuecomment-222043154
  
    **[Test build #59448 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/59448/consoleFull)** for PR 13088 at commit [`ed6058f`](https://github.com/apache/spark/commit/ed6058f8b473a4ea0f82ee010d7468ad5ca54efb).


---
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-15236][SQL][SPARK SHELL] Add spark-defa...

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

    https://github.com/apache/spark/pull/13088#discussion_r64811442
  
    --- Diff: repl/scala-2.11/src/main/scala/org/apache/spark/repl/Main.scala ---
    @@ -88,10 +88,22 @@ object Main extends Logging {
         }
     
         val builder = SparkSession.builder.config(conf)
    -    if (SparkSession.hiveClassesArePresent) {
    -      sparkSession = builder.enableHiveSupport().getOrCreate()
    -      logInfo("Created Spark session with Hive support")
    +    if (conf.get("spark.sql.catalogImplementation", "hive").toLowerCase == "hive") {
    --- End diff --
    
    Yes. I will change it. 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-15236][SQL][SPARK SHELL] Add spark-defaults prope...

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

    https://github.com/apache/spark/pull/13088
  
    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-15236][SQL][SPARK SHELL] Add spark-defaults prope...

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

    https://github.com/apache/spark/pull/13088#discussion_r65268143
  
    --- Diff: repl/scala-2.11/src/main/scala/org/apache/spark/repl/Main.scala ---
    @@ -88,12 +89,25 @@ object Main extends Logging {
         }
     
         val builder = SparkSession.builder.config(conf)
    -    if (SparkSession.hiveClassesArePresent) {
    -      sparkSession = builder.enableHiveSupport().getOrCreate()
    -      logInfo("Created Spark session with Hive support")
    +    if (conf.get(CATALOG_IMPLEMENTATION.key, "hive").toLowerCase == "hive") {
    +      if (SparkSession.hiveClassesArePresent) {
    +        // In the case that the property is not set at all, builder's config
    +        // does not have this value set to 'hive' yet. The original default
    +        // behavior is that when there are hive classes, we use hive catalog.
    +        sparkSession = builder.enableHiveSupport().getOrCreate()
    +        logInfo("Created Spark session with Hive catalog")
    --- End diff --
    
    OK. will change.


---
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-15236][SQL][SPARK SHELL] Add spark-defa...

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

    https://github.com/apache/spark/pull/13088#issuecomment-221948371
  
    **[Test build #59390 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/59390/consoleFull)** for PR 13088 at commit [`9c3bd5a`](https://github.com/apache/spark/commit/9c3bd5aab9a12339e0957706cfe8671c040c4c43).
     * 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-15236][SQL][SPARK SHELL] Add spark-defa...

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

    https://github.com/apache/spark/pull/13088#issuecomment-222056227
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/59448/
    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-15236][SQL][SPARK SHELL] Add spark-defaults prope...

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

    https://github.com/apache/spark/pull/13088
  
    @andrewor14 Many 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-15236][SQL][SPARK SHELL] Add spark-defa...

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

    https://github.com/apache/spark/pull/13088#issuecomment-220516958
  
    @rxin @yhuai @andrewor14 Please help check if the updated change is in the right direction, Thank you very much!


---
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-15236][SQL][SPARK SHELL] Add spark-defa...

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

    https://github.com/apache/spark/pull/13088#issuecomment-219201641
  
    @rxin I updated the code to use existing property `spark.sql.catalogImplementation` when checking whether we should switch to use in-memory or hive catalog. The default is to use hive catalog as long as there are hive classes. If the property is set to non hive, repl will create sparkSession with InMemoryCatalog. If the property is set to `hive`, but no hive classes are present, repl will also use InMemoryCatalog. 
    Please check if this is the right direction. Many 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-15236][SQL][SPARK SHELL] Add spark-defaults prope...

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

    https://github.com/apache/spark/pull/13088
  
    LGTM thanks for working on this. 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-15236][SQL][SPARK SHELL] Add spark-defaults prope...

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

    https://github.com/apache/spark/pull/13088#discussion_r65268138
  
    --- Diff: repl/scala-2.11/src/main/scala/org/apache/spark/repl/Main.scala ---
    @@ -88,12 +89,25 @@ object Main extends Logging {
         }
     
         val builder = SparkSession.builder.config(conf)
    -    if (SparkSession.hiveClassesArePresent) {
    -      sparkSession = builder.enableHiveSupport().getOrCreate()
    -      logInfo("Created Spark session with Hive support")
    +    if (conf.get(CATALOG_IMPLEMENTATION.key, "hive").toLowerCase == "hive") {
    +      if (SparkSession.hiveClassesArePresent) {
    +        // In the case that the property is not set at all, builder's config
    +        // does not have this value set to 'hive' yet. The original default
    +        // behavior is that when there are hive classes, we use hive catalog.
    +        sparkSession = builder.enableHiveSupport().getOrCreate()
    +        logInfo("Created Spark session with Hive catalog")
    +      } else {
    +        // Need to change it back to 'in-memory' if no hive classes are found
    +        // in the case that the property is set to hive in spark-defaults.conf
    +        builder.config(CATALOG_IMPLEMENTATION.key, "in-memory")
    +        sparkSession = builder.getOrCreate()
    +        logInfo("Created Spark session with in-memory catalog")
    --- End diff --
    
    OK. Cool. Will change. 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-15236][SQL][SPARK SHELL] Add spark-defaults prope...

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

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