aboutsummaryrefslogtreecommitdiff
path: root/sql/catalyst
diff options
context:
space:
mode:
authorgatorsmile <gatorsmile@gmail.com>2016-05-05 14:34:24 -0700
committerAndrew Or <andrew@databricks.com>2016-05-05 14:34:24 -0700
commit8cba57a75cf9e29b54d97366a039a97a2f305d5d (patch)
treeb9cb57154348cd0242deeff9a78e346e7b04aaa6 /sql/catalyst
parent63db2bd283a430971d85f2a7b06dac77723c56fa (diff)
downloadspark-8cba57a75cf9e29b54d97366a039a97a2f305d5d.tar.gz
spark-8cba57a75cf9e29b54d97366a039a97a2f305d5d.tar.bz2
spark-8cba57a75cf9e29b54d97366a039a97a2f305d5d.zip
[SPARK-14124][SQL][FOLLOWUP] Implement Database-related DDL Commands
#### What changes were proposed in this pull request? First, a few test cases failed in mac OS X because the property value of `java.io.tmpdir` does not include a trailing slash on some platform. Hive always removes the last trailing slash. For example, what I got in the web: ``` Win NT --> C:\TEMP\ Win XP --> C:\TEMP Solaris --> /var/tmp/ Linux --> /var/tmp ``` Second, a couple of test cases are added to verify if the commands work properly. #### How was this patch tested? Added a test case for it and correct the previous test cases. Author: gatorsmile <gatorsmile@gmail.com> Author: xiaoli <lixiao1983@gmail.com> Author: Xiao Li <xiaoli@Xiaos-MacBook-Pro.local> Closes #12081 from gatorsmile/mkdir.
Diffstat (limited to 'sql/catalyst')
-rw-r--r--sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/catalog/SessionCatalog.scala4
1 files changed, 4 insertions, 0 deletions
diff --git a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/catalog/SessionCatalog.scala b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/catalog/SessionCatalog.scala
index ff6303471e..eff420eb4c 100644
--- a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/catalog/SessionCatalog.scala
+++ b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/catalog/SessionCatalog.scala
@@ -146,6 +146,10 @@ class SessionCatalog(
currentDb = db
}
+ /**
+ * Get the path for creating a non-default database when database location is not provided
+ * by users.
+ */
def getDefaultDBPath(db: String): String = {
val database = if (conf.caseSensitiveAnalysis) db else db.toLowerCase
new Path(new Path(conf.warehousePath), database + ".db").toString