spark git commit: [MINOR][SQL] Add prettyName for current_database function
Repository: spark Updated Branches: refs/heads/master e18d02c5a -> 56b0f5f4d [MINOR][SQL] Add prettyName for current_database function ## What changes were proposed in this pull request? Added a `prettyname` for current_database function. ## How was this patch tested? Manually. Before: ``` scala> sql("select current_database()").show +-+ |currentdatabase()| +-+ | default| +-+ ``` After: ``` scala> sql("select current_database()").show +--+ |current_database()| +--+ | default| +--+ ``` Author: Weiqing Yang Closes #15506 from weiqingy/prettyName. Project: http://git-wip-us.apache.org/repos/asf/spark/repo Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/56b0f5f4 Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/56b0f5f4 Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/56b0f5f4 Branch: refs/heads/master Commit: 56b0f5f4d1d7826737b81ebc4ec5dad83b6463e3 Parents: e18d02c Author: Weiqing Yang Authored: Sun Oct 16 22:38:30 2016 -0700 Committer: Reynold Xin Committed: Sun Oct 16 22:38:30 2016 -0700 -- .../main/scala/org/apache/spark/sql/catalyst/expressions/misc.scala | 1 + 1 file changed, 1 insertion(+) -- http://git-wip-us.apache.org/repos/asf/spark/blob/56b0f5f4/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/misc.scala -- diff --git a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/misc.scala b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/misc.scala index 138ef2a..5ead169 100644 --- a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/misc.scala +++ b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/misc.scala @@ -618,6 +618,7 @@ case class CurrentDatabase() extends LeafExpression with Unevaluable { override def dataType: DataType = StringType override def foldable: Boolean = true override def nullable: Boolean = false + override def prettyName: String = "current_database" } /** - To unsubscribe, e-mail: commits-unsubscr...@spark.apache.org For additional commands, e-mail: commits-h...@spark.apache.org
spark git commit: [MINOR][SQL] Add prettyName for current_database function
Repository: spark Updated Branches: refs/heads/branch-2.0 3cc2fe5b9 -> ca66f52ff [MINOR][SQL] Add prettyName for current_database function ## What changes were proposed in this pull request? Added a `prettyname` for current_database function. ## How was this patch tested? Manually. Before: ``` scala> sql("select current_database()").show +-+ |currentdatabase()| +-+ | default| +-+ ``` After: ``` scala> sql("select current_database()").show +--+ |current_database()| +--+ | default| +--+ ``` Author: Weiqing Yang Closes #15506 from weiqingy/prettyName. (cherry picked from commit 56b0f5f4d1d7826737b81ebc4ec5dad83b6463e3) Signed-off-by: Reynold Xin Project: http://git-wip-us.apache.org/repos/asf/spark/repo Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/ca66f52f Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/ca66f52f Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/ca66f52f Branch: refs/heads/branch-2.0 Commit: ca66f52ff81c19e17ca3733eac92d66012a3ec6e Parents: 3cc2fe5 Author: Weiqing Yang Authored: Sun Oct 16 22:38:30 2016 -0700 Committer: Reynold Xin Committed: Sun Oct 16 22:38:36 2016 -0700 -- .../main/scala/org/apache/spark/sql/catalyst/expressions/misc.scala | 1 + 1 file changed, 1 insertion(+) -- http://git-wip-us.apache.org/repos/asf/spark/blob/ca66f52f/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/misc.scala -- diff --git a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/misc.scala b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/misc.scala index 92f8fb8..5c4436f 100644 --- a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/misc.scala +++ b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/misc.scala @@ -564,4 +564,5 @@ case class CurrentDatabase() extends LeafExpression with Unevaluable { override def dataType: DataType = StringType override def foldable: Boolean = true override def nullable: Boolean = false + override def prettyName: String = "current_database" } - To unsubscribe, e-mail: commits-unsubscr...@spark.apache.org For additional commands, e-mail: commits-h...@spark.apache.org
[spark] Git Push Summary
Repository: spark Updated Tags: refs/tags/v1.6.3-rc1 [created] 7375bb0c8 - To unsubscribe, e-mail: commits-unsubscr...@spark.apache.org For additional commands, e-mail: commits-h...@spark.apache.org
[spark] Git Push Summary
Repository: spark Updated Tags: refs/tags/v1.6.3 [deleted] 7375bb0c8 - To unsubscribe, e-mail: commits-unsubscr...@spark.apache.org For additional commands, e-mail: commits-h...@spark.apache.org
[2/2] spark git commit: Preparing development version 1.6.4-SNAPSHOT
Preparing development version 1.6.4-SNAPSHOT Project: http://git-wip-us.apache.org/repos/asf/spark/repo Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/b95ac0d0 Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/b95ac0d0 Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/b95ac0d0 Branch: refs/heads/branch-1.6 Commit: b95ac0d002e549ce2b80301f0db59d37a6697aa8 Parents: 7375bb0 Author: Patrick Wendell Authored: Sun Oct 16 22:23:31 2016 -0700 Committer: Patrick Wendell Committed: Sun Oct 16 22:23:31 2016 -0700 -- R/pkg/DESCRIPTION | 2 +- assembly/pom.xml| 2 +- bagel/pom.xml | 2 +- core/pom.xml| 2 +- docker-integration-tests/pom.xml| 2 +- docs/_config.yml| 4 ++-- examples/pom.xml| 2 +- external/flume-assembly/pom.xml | 2 +- external/flume-sink/pom.xml | 2 +- external/flume/pom.xml | 2 +- external/kafka-assembly/pom.xml | 2 +- external/kafka/pom.xml | 2 +- external/mqtt-assembly/pom.xml | 2 +- external/mqtt/pom.xml | 2 +- external/twitter/pom.xml| 2 +- external/zeromq/pom.xml | 2 +- extras/java8-tests/pom.xml | 2 +- extras/kinesis-asl-assembly/pom.xml | 2 +- extras/kinesis-asl/pom.xml | 2 +- extras/spark-ganglia-lgpl/pom.xml | 2 +- graphx/pom.xml | 2 +- launcher/pom.xml| 2 +- mllib/pom.xml | 2 +- network/common/pom.xml | 2 +- network/shuffle/pom.xml | 2 +- network/yarn/pom.xml| 2 +- pom.xml | 2 +- repl/pom.xml| 2 +- sql/catalyst/pom.xml| 2 +- sql/core/pom.xml| 2 +- sql/hive-thriftserver/pom.xml | 2 +- sql/hive/pom.xml| 2 +- streaming/pom.xml | 2 +- tags/pom.xml| 2 +- tools/pom.xml | 2 +- unsafe/pom.xml | 2 +- yarn/pom.xml| 2 +- 37 files changed, 38 insertions(+), 38 deletions(-) -- http://git-wip-us.apache.org/repos/asf/spark/blob/b95ac0d0/R/pkg/DESCRIPTION -- diff --git a/R/pkg/DESCRIPTION b/R/pkg/DESCRIPTION index 7e9fd2d..f237df1 100644 --- a/R/pkg/DESCRIPTION +++ b/R/pkg/DESCRIPTION @@ -1,7 +1,7 @@ Package: SparkR Type: Package Title: R frontend for Spark -Version: 1.6.3 +Version: 1.6.4 Date: 2013-09-09 Author: The Apache Software Foundation Maintainer: Shivaram Venkataraman http://git-wip-us.apache.org/repos/asf/spark/blob/b95ac0d0/assembly/pom.xml -- diff --git a/assembly/pom.xml b/assembly/pom.xml index 8e9747e..13cf555 100644 --- a/assembly/pom.xml +++ b/assembly/pom.xml @@ -21,7 +21,7 @@ org.apache.spark spark-parent_2.10 -1.6.3 +1.6.4-SNAPSHOT ../pom.xml http://git-wip-us.apache.org/repos/asf/spark/blob/b95ac0d0/bagel/pom.xml -- diff --git a/bagel/pom.xml b/bagel/pom.xml index a73a18a..e080625 100644 --- a/bagel/pom.xml +++ b/bagel/pom.xml @@ -21,7 +21,7 @@ org.apache.spark spark-parent_2.10 -1.6.3 +1.6.4-SNAPSHOT ../pom.xml http://git-wip-us.apache.org/repos/asf/spark/blob/b95ac0d0/core/pom.xml -- diff --git a/core/pom.xml b/core/pom.xml index c232046..f60bd00 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -21,7 +21,7 @@ org.apache.spark spark-parent_2.10 -1.6.3 +1.6.4-SNAPSHOT ../pom.xml http://git-wip-us.apache.org/repos/asf/spark/blob/b95ac0d0/docker-integration-tests/pom.xml -- diff --git a/docker-integration-tests/pom.xml b/docker-integration-tests/pom.xml index 8514b48..8d5eb40 100644 --- a/docker-integration-tests/pom.xml +++ b/docker-integration-tests/pom.xml @@ -22,7 +22,7 @@ org.apache.spark spark-parent_2.10 -1.6.3 +1.6.4-SNAPSHOT ../pom.xml http://git-wip-us.apache.org/repos/asf/spark/blob/b95ac0d0/docs/_config.yml -- diff --git a/docs/_config.yml b/docs/_config.yml index 81dcb2c..ee235bc 100644 --- a/docs/_config.yml +++ b/docs/_config.yml @@ -14,8 +14,8 @@ include: # These allow the documentation to be updated with newer releases # of Spark, Scala, and Mesos. -SPARK_VERSION: 1.6.3 -SPARK_VERSION_SHORT: 1.6.3 +SPARK_VERSION: 1.6.4-SNAPSHOT +SPARK_VERSION_SHORT: 1.6.4 SCALA_BINARY_VERSION: "2.1
[1/2] spark git commit: Preparing Spark release v1.6.3
Repository: spark Updated Branches: refs/heads/branch-1.6 0f577857c -> b95ac0d00 Preparing Spark release v1.6.3 Project: http://git-wip-us.apache.org/repos/asf/spark/repo Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/7375bb0c Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/7375bb0c Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/7375bb0c Branch: refs/heads/branch-1.6 Commit: 7375bb0c825408ea010dcef31c0759cf94ffe5c2 Parents: 0f57785 Author: Patrick Wendell Authored: Sun Oct 16 22:23:21 2016 -0700 Committer: Patrick Wendell Committed: Sun Oct 16 22:23:21 2016 -0700 -- assembly/pom.xml| 2 +- bagel/pom.xml | 2 +- core/pom.xml| 2 +- docker-integration-tests/pom.xml| 2 +- examples/pom.xml| 2 +- external/flume-assembly/pom.xml | 2 +- external/flume-sink/pom.xml | 2 +- external/flume/pom.xml | 2 +- external/kafka-assembly/pom.xml | 2 +- external/kafka/pom.xml | 2 +- external/mqtt-assembly/pom.xml | 2 +- external/mqtt/pom.xml | 2 +- external/twitter/pom.xml| 2 +- external/zeromq/pom.xml | 2 +- extras/java8-tests/pom.xml | 2 +- extras/kinesis-asl-assembly/pom.xml | 2 +- extras/kinesis-asl/pom.xml | 2 +- extras/spark-ganglia-lgpl/pom.xml | 2 +- graphx/pom.xml | 2 +- launcher/pom.xml| 2 +- mllib/pom.xml | 2 +- network/common/pom.xml | 2 +- network/shuffle/pom.xml | 2 +- network/yarn/pom.xml| 2 +- pom.xml | 2 +- repl/pom.xml| 2 +- sql/catalyst/pom.xml| 2 +- sql/core/pom.xml| 2 +- sql/hive-thriftserver/pom.xml | 2 +- sql/hive/pom.xml| 2 +- streaming/pom.xml | 2 +- tags/pom.xml| 2 +- tools/pom.xml | 2 +- unsafe/pom.xml | 2 +- yarn/pom.xml| 2 +- 35 files changed, 35 insertions(+), 35 deletions(-) -- http://git-wip-us.apache.org/repos/asf/spark/blob/7375bb0c/assembly/pom.xml -- diff --git a/assembly/pom.xml b/assembly/pom.xml index 6ec2ca4..8e9747e 100644 --- a/assembly/pom.xml +++ b/assembly/pom.xml @@ -21,7 +21,7 @@ org.apache.spark spark-parent_2.10 -1.6.3-SNAPSHOT +1.6.3 ../pom.xml http://git-wip-us.apache.org/repos/asf/spark/blob/7375bb0c/bagel/pom.xml -- diff --git a/bagel/pom.xml b/bagel/pom.xml index 2d778c5..a73a18a 100644 --- a/bagel/pom.xml +++ b/bagel/pom.xml @@ -21,7 +21,7 @@ org.apache.spark spark-parent_2.10 -1.6.3-SNAPSHOT +1.6.3 ../pom.xml http://git-wip-us.apache.org/repos/asf/spark/blob/7375bb0c/core/pom.xml -- diff --git a/core/pom.xml b/core/pom.xml index a8d7863..c232046 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -21,7 +21,7 @@ org.apache.spark spark-parent_2.10 -1.6.3-SNAPSHOT +1.6.3 ../pom.xml http://git-wip-us.apache.org/repos/asf/spark/blob/7375bb0c/docker-integration-tests/pom.xml -- diff --git a/docker-integration-tests/pom.xml b/docker-integration-tests/pom.xml index a06e59c..8514b48 100644 --- a/docker-integration-tests/pom.xml +++ b/docker-integration-tests/pom.xml @@ -22,7 +22,7 @@ org.apache.spark spark-parent_2.10 -1.6.3-SNAPSHOT +1.6.3 ../pom.xml http://git-wip-us.apache.org/repos/asf/spark/blob/7375bb0c/examples/pom.xml -- diff --git a/examples/pom.xml b/examples/pom.xml index 8e9e02e..87850fe 100644 --- a/examples/pom.xml +++ b/examples/pom.xml @@ -21,7 +21,7 @@ org.apache.spark spark-parent_2.10 -1.6.3-SNAPSHOT +1.6.3 ../pom.xml http://git-wip-us.apache.org/repos/asf/spark/blob/7375bb0c/external/flume-assembly/pom.xml -- diff --git a/external/flume-assembly/pom.xml b/external/flume-assembly/pom.xml index 52c8a91..0173c08 100644 --- a/external/flume-assembly/pom.xml +++ b/external/flume-assembly/pom.xml @@ -21,7 +21,7 @@ org.apache.spark spark-parent_2.10 -1.6.3-SNAPSHOT +1.6.3 ../../pom.xml http://git-wip-us.apache.org/repos/asf/spark/blob/7375bb0c/external/flume-sink/pom.xml -- diff --git a/
[spark] Git Push Summary
Repository: spark Updated Tags: refs/tags/v1.6.3 [created] 7375bb0c8 - To unsubscribe, e-mail: commits-unsubscr...@spark.apache.org For additional commands, e-mail: commits-h...@spark.apache.org
spark git commit: Prepare branch-1.6 for 1.6.3 release.
Repository: spark Updated Branches: refs/heads/branch-1.6 745c5e70f -> 0f577857c Prepare branch-1.6 for 1.6.3 release. Project: http://git-wip-us.apache.org/repos/asf/spark/repo Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/0f577857 Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/0f577857 Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/0f577857 Branch: refs/heads/branch-1.6 Commit: 0f577857cc91a27fbdaa4b0cfef84c6b54013b42 Parents: 745c5e7 Author: Reynold Xin Authored: Sun Oct 16 22:21:04 2016 -0700 Committer: Reynold Xin Committed: Sun Oct 16 22:21:04 2016 -0700 -- R/pkg/DESCRIPTION | 2 +- core/src/main/scala/org/apache/spark/package.scala | 2 +- docs/_config.yml | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) -- http://git-wip-us.apache.org/repos/asf/spark/blob/0f577857/R/pkg/DESCRIPTION -- diff --git a/R/pkg/DESCRIPTION b/R/pkg/DESCRIPTION index 635a04e..7e9fd2d 100644 --- a/R/pkg/DESCRIPTION +++ b/R/pkg/DESCRIPTION @@ -1,7 +1,7 @@ Package: SparkR Type: Package Title: R frontend for Spark -Version: 1.6.1 +Version: 1.6.3 Date: 2013-09-09 Author: The Apache Software Foundation Maintainer: Shivaram Venkataraman http://git-wip-us.apache.org/repos/asf/spark/blob/0f577857/core/src/main/scala/org/apache/spark/package.scala -- diff --git a/core/src/main/scala/org/apache/spark/package.scala b/core/src/main/scala/org/apache/spark/package.scala index 1499d14..f8c1f29 100644 --- a/core/src/main/scala/org/apache/spark/package.scala +++ b/core/src/main/scala/org/apache/spark/package.scala @@ -43,5 +43,5 @@ package org.apache package object spark { // For package docs only - val SPARK_VERSION = "1.6.2" + val SPARK_VERSION = "1.6.3" } http://git-wip-us.apache.org/repos/asf/spark/blob/0f577857/docs/_config.yml -- diff --git a/docs/_config.yml b/docs/_config.yml index c2ecb59..81dcb2c 100644 --- a/docs/_config.yml +++ b/docs/_config.yml @@ -14,8 +14,8 @@ include: # These allow the documentation to be updated with newer releases # of Spark, Scala, and Mesos. -SPARK_VERSION: 1.6.2 -SPARK_VERSION_SHORT: 1.6.2 +SPARK_VERSION: 1.6.3 +SPARK_VERSION_SHORT: 1.6.3 SCALA_BINARY_VERSION: "2.10" SCALA_VERSION: "2.10.5" MESOS_VERSION: 0.21.0 - To unsubscribe, e-mail: commits-unsubscr...@spark.apache.org For additional commands, e-mail: commits-h...@spark.apache.org
spark git commit: [SPARK-17819][SQL][BRANCH-2.0] Support default database in connection URIs for Spark Thrift Server
Repository: spark Updated Branches: refs/heads/branch-2.0 2a1b10b64 -> 3cc2fe5b9 [SPARK-17819][SQL][BRANCH-2.0] Support default database in connection URIs for Spark Thrift Server ## What changes were proposed in this pull request? Currently, Spark Thrift Server ignores the default database in URI. This PR supports that like the following. ```sql $ bin/beeline -u jdbc:hive2://localhost:1 -e "create database testdb" $ bin/beeline -u jdbc:hive2://localhost:1/testdb -e "create table t(a int)" $ bin/beeline -u jdbc:hive2://localhost:1/testdb -e "show tables" ... ++--+--+ | tableName | isTemporary | ++--+--+ | t | false| ++--+--+ 1 row selected (0.347 seconds) $ bin/beeline -u jdbc:hive2://localhost:1 -e "show tables" ... ++--+--+ | tableName | isTemporary | ++--+--+ ++--+--+ No rows selected (0.098 seconds) ``` ## How was this patch tested? Pass the Jenkins with a newly added testsuite. Author: Dongjoon Hyun Closes #15507 from dongjoon-hyun/SPARK-17819-BACK. Project: http://git-wip-us.apache.org/repos/asf/spark/repo Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/3cc2fe5b Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/3cc2fe5b Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/3cc2fe5b Branch: refs/heads/branch-2.0 Commit: 3cc2fe5b94d3bcdfb4f28bfa6d8e51fe67d6e1b4 Parents: 2a1b10b Author: Dongjoon Hyun Authored: Sun Oct 16 22:15:47 2016 -0700 Committer: Reynold Xin Committed: Sun Oct 16 22:15:47 2016 -0700 -- .../thriftserver/SparkSQLSessionManager.scala | 3 + .../thriftserver/JdbcConnectionUriSuite.scala | 70 2 files changed, 73 insertions(+) -- http://git-wip-us.apache.org/repos/asf/spark/blob/3cc2fe5b/sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/SparkSQLSessionManager.scala -- diff --git a/sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/SparkSQLSessionManager.scala b/sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/SparkSQLSessionManager.scala index 1e4c479..fc5b221 100644 --- a/sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/SparkSQLSessionManager.scala +++ b/sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/SparkSQLSessionManager.scala @@ -79,6 +79,9 @@ private[hive] class SparkSQLSessionManager(hiveServer: HiveServer2, sqlContext: sqlContext.newSession() } ctx.setConf("spark.sql.hive.version", HiveUtils.hiveExecutionVersion) +if (sessionConf != null && sessionConf.containsKey("use:database")) { + ctx.sql(s"use ${sessionConf.get("use:database")}") +} sparkSqlOperationManager.sessionToContexts += sessionHandle -> ctx sessionHandle } http://git-wip-us.apache.org/repos/asf/spark/blob/3cc2fe5b/sql/hive-thriftserver/src/test/scala/org/apache/spark/sql/hive/thriftserver/JdbcConnectionUriSuite.scala -- diff --git a/sql/hive-thriftserver/src/test/scala/org/apache/spark/sql/hive/thriftserver/JdbcConnectionUriSuite.scala b/sql/hive-thriftserver/src/test/scala/org/apache/spark/sql/hive/thriftserver/JdbcConnectionUriSuite.scala new file mode 100644 index 000..fb8a7e2 --- /dev/null +++ b/sql/hive-thriftserver/src/test/scala/org/apache/spark/sql/hive/thriftserver/JdbcConnectionUriSuite.scala @@ -0,0 +1,70 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + *http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.spark.sql.hive.thriftserver + +import java.sql.DriverManager + +import org.apache.hive.jdbc.HiveDriver + +import org.apache.spark.util.Utils + +class JdbcConnectionUriSuite extends HiveThriftServer2Test { + Utils.classForName(classOf[HiveDriver].getCanonicalName) + + override def mode: ServerMode.Value = ServerMode.binary + + val JDBC_TEST_DATABASE = "jdbc_test_database" + va
spark git commit: [SPARK-17947][SQL] Add Doc and Comment about spark.sql.debug
Repository: spark Updated Branches: refs/heads/master 59e3eb5af -> e18d02c5a [SPARK-17947][SQL] Add Doc and Comment about spark.sql.debug ### What changes were proposed in this pull request? Just document the impact of `spark.sql.debug`: When enabling the debug, Spark SQL internal table properties are not filtered out; however, some related DDL commands (e.g., Analyze Table and CREATE TABLE LIKE) might not work properly. ### How was this patch tested? N/A Author: gatorsmile Closes #15494 from gatorsmile/addDocForSQLDebug. Project: http://git-wip-us.apache.org/repos/asf/spark/repo Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/e18d02c5 Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/e18d02c5 Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/e18d02c5 Branch: refs/heads/master Commit: e18d02c5a8f8af2e42079ab414f5d84b3e1a279e Parents: 59e3eb5 Author: gatorsmile Authored: Mon Oct 17 12:08:25 2016 +0800 Committer: Wenchen Fan Committed: Mon Oct 17 12:08:25 2016 +0800 -- .../src/main/scala/org/apache/spark/sql/internal/SQLConf.scala| 3 +++ 1 file changed, 3 insertions(+) -- http://git-wip-us.apache.org/repos/asf/spark/blob/e18d02c5/sql/core/src/main/scala/org/apache/spark/sql/internal/SQLConf.scala -- diff --git a/sql/core/src/main/scala/org/apache/spark/sql/internal/SQLConf.scala b/sql/core/src/main/scala/org/apache/spark/sql/internal/SQLConf.scala index e73d018..a055e01 100644 --- a/sql/core/src/main/scala/org/apache/spark/sql/internal/SQLConf.scala +++ b/sql/core/src/main/scala/org/apache/spark/sql/internal/SQLConf.scala @@ -934,8 +934,11 @@ object StaticSQLConf { .intConf .createWithDefault(4000) + // When enabling the debug, Spark SQL internal table properties are not filtered out; however, + // some related DDL commands (e.g., ANALYZE TABLE and CREATE TABLE LIKE) might not work properly. val DEBUG_MODE = buildConf("spark.sql.debug") .internal() +.doc("Only used for internal debugging. Not all functions are supported when it is enabled.") .booleanConf .createWithDefault(false) } - To unsubscribe, e-mail: commits-unsubscr...@spark.apache.org For additional commands, e-mail: commits-h...@spark.apache.org
spark git commit: [SPARK-17819][SQL] Support default database in connection URIs for Spark Thrift Server
Repository: spark Updated Branches: refs/heads/master 72a6e7a57 -> 59e3eb5af [SPARK-17819][SQL] Support default database in connection URIs for Spark Thrift Server ## What changes were proposed in this pull request? Currently, Spark Thrift Server ignores the default database in URI. This PR supports that like the following. ```sql $ bin/beeline -u jdbc:hive2://localhost:1 -e "create database testdb" $ bin/beeline -u jdbc:hive2://localhost:1/testdb -e "create table t(a int)" $ bin/beeline -u jdbc:hive2://localhost:1/testdb -e "show tables" ... ++--+--+ | tableName | isTemporary | ++--+--+ | t | false| ++--+--+ 1 row selected (0.347 seconds) $ bin/beeline -u jdbc:hive2://localhost:1 -e "show tables" ... ++--+--+ | tableName | isTemporary | ++--+--+ ++--+--+ No rows selected (0.098 seconds) ``` ## How was this patch tested? Manual. Note: I tried to add a test case for this, but I cannot found a suitable testsuite for this. I'll add the testcase if some advice is given. Author: Dongjoon Hyun Closes #15399 from dongjoon-hyun/SPARK-17819. Project: http://git-wip-us.apache.org/repos/asf/spark/repo Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/59e3eb5a Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/59e3eb5a Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/59e3eb5a Branch: refs/heads/master Commit: 59e3eb5af8d0969bbb785af77b66343bda7acc38 Parents: 72a6e7a Author: Dongjoon Hyun Authored: Sun Oct 16 20:15:32 2016 -0700 Committer: Reynold Xin Committed: Sun Oct 16 20:15:32 2016 -0700 -- .../thriftserver/SparkSQLSessionManager.scala | 3 + .../thriftserver/JdbcConnectionUriSuite.scala | 70 2 files changed, 73 insertions(+) -- http://git-wip-us.apache.org/repos/asf/spark/blob/59e3eb5a/sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/SparkSQLSessionManager.scala -- diff --git a/sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/SparkSQLSessionManager.scala b/sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/SparkSQLSessionManager.scala index 6a5117a..226b7e1 100644 --- a/sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/SparkSQLSessionManager.scala +++ b/sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/SparkSQLSessionManager.scala @@ -79,6 +79,9 @@ private[hive] class SparkSQLSessionManager(hiveServer: HiveServer2, sqlContext: sqlContext.newSession() } ctx.setConf("spark.sql.hive.version", HiveUtils.hiveExecutionVersion) +if (sessionConf != null && sessionConf.containsKey("use:database")) { + ctx.sql(s"use ${sessionConf.get("use:database")}") +} sparkSqlOperationManager.sessionToContexts.put(sessionHandle, ctx) sessionHandle } http://git-wip-us.apache.org/repos/asf/spark/blob/59e3eb5a/sql/hive-thriftserver/src/test/scala/org/apache/spark/sql/hive/thriftserver/JdbcConnectionUriSuite.scala -- diff --git a/sql/hive-thriftserver/src/test/scala/org/apache/spark/sql/hive/thriftserver/JdbcConnectionUriSuite.scala b/sql/hive-thriftserver/src/test/scala/org/apache/spark/sql/hive/thriftserver/JdbcConnectionUriSuite.scala new file mode 100644 index 000..fb8a7e2 --- /dev/null +++ b/sql/hive-thriftserver/src/test/scala/org/apache/spark/sql/hive/thriftserver/JdbcConnectionUriSuite.scala @@ -0,0 +1,70 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + *http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.spark.sql.hive.thriftserver + +import java.sql.DriverManager + +import org.apache.hive.jdbc.HiveDriver + +import org.apache.spark.util.Utils + +class JdbcConnectionUriSuite extends HiveThriftServer2Test { + Utils.classForName(classOf[HiveDriver].getCanonicalName) + + override def mode: ServerMode.Valu