aboutsummaryrefslogtreecommitdiff
path: root/sql/catalyst/src
diff options
context:
space:
mode:
authorYin Huai <yhuai@databricks.com>2016-04-23 22:29:31 -0700
committerYin Huai <yhuai@databricks.com>2016-04-23 22:29:31 -0700
commit1672149c2644b5670b4b9a4086a4456fb8279a55 (patch)
tree0b90c17e83d037de61577acd360446803daa6c98 /sql/catalyst/src
parent28538596558b7f69f9d22eb0902d0e609d98be88 (diff)
downloadspark-1672149c2644b5670b4b9a4086a4456fb8279a55.tar.gz
spark-1672149c2644b5670b4b9a4086a4456fb8279a55.tar.bz2
spark-1672149c2644b5670b4b9a4086a4456fb8279a55.zip
[SPARK-14879][SQL] Move CreateMetastoreDataSource and CreateMetastoreDataSourceAsSelect to sql/core
## What changes were proposed in this pull request? CreateMetastoreDataSource and CreateMetastoreDataSourceAsSelect are not Hive-specific. So, this PR moves them from sql/hive to sql/core. Also, I am adding `Command` suffix to these two classes. ## How was this patch tested? Existing tests. Author: Yin Huai <yhuai@databricks.com> Closes #12645 from yhuai/moveCreateDataSource.
Diffstat (limited to 'sql/catalyst/src')
-rw-r--r--sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/catalog/SessionCatalog.scala9
1 files changed, 9 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 152bd499a0..67b1752ee8 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
@@ -21,6 +21,8 @@ import java.io.File
import scala.collection.mutable
+import org.apache.hadoop.fs.Path
+
import org.apache.spark.internal.Logging
import org.apache.spark.sql.AnalysisException
import org.apache.spark.sql.catalyst.{CatalystConf, SimpleCatalystConf}
@@ -221,6 +223,13 @@ class SessionCatalog(
inheritTableSpecs, isSkewedStoreAsSubdir)
}
+ def defaultTablePath(tableIdent: TableIdentifier): String = {
+ val dbName = tableIdent.database.getOrElse(currentDb)
+ val dbLocation = getDatabaseMetadata(dbName).locationUri
+
+ new Path(new Path(dbLocation), formatTableName(tableIdent.table)).toString
+ }
+
// -------------------------------------------------------------
// | Methods that interact with temporary and metastore tables |
// -------------------------------------------------------------