diff options
author | gatorsmile <gatorsmile@gmail.com> | 2017-01-03 11:55:31 +0800 |
---|---|---|
committer | Wenchen Fan <wenchen@databricks.com> | 2017-01-03 11:55:31 +0800 |
commit | a6cd9dbc6095570e93dab1d93671abecdce40c25 (patch) | |
tree | c4b38ddad4ece7448a27a1b7b8967d7a88ed80e9 /sql/catalyst/src/main | |
parent | 46b212602428f1f11c184c836b4e09c150d0ee30 (diff) | |
download | spark-a6cd9dbc6095570e93dab1d93671abecdce40c25.tar.gz spark-a6cd9dbc6095570e93dab1d93671abecdce40c25.tar.bz2 spark-a6cd9dbc6095570e93dab1d93671abecdce40c25.zip |
[SPARK-19029][SQL] Remove databaseName from SimpleCatalogRelation
### What changes were proposed in this pull request?
Remove useless `databaseName ` from `SimpleCatalogRelation`.
### How was this patch tested?
Existing test cases.
Author: gatorsmile <gatorsmile@gmail.com>
Closes #16438 from gatorsmile/removeDBFromSimpleCatalogRelation.
Diffstat (limited to 'sql/catalyst/src/main')
-rw-r--r-- | sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/catalog/SessionCatalog.scala | 2 | ||||
-rw-r--r-- | sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/catalog/interface.scala | 5 |
2 files changed, 1 insertions, 6 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 741ed05b63..2060d535b0 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 @@ -573,7 +573,7 @@ class SessionCatalog( val view = Option(metadata.tableType).collect { case CatalogTableType.VIEW => name } - SubqueryAlias(relationAlias, SimpleCatalogRelation(db, metadata), view) + SubqueryAlias(relationAlias, SimpleCatalogRelation(metadata), view) } else { SubqueryAlias(relationAlias, tempTables(table), Option(name)) } diff --git a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/catalog/interface.scala b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/catalog/interface.scala index 24d75ab02c..b402bd2d6c 100644 --- a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/catalog/interface.scala +++ b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/catalog/interface.scala @@ -318,7 +318,6 @@ trait CatalogRelation { * Note that in the future we should consolidate this and HiveCatalogRelation. */ case class SimpleCatalogRelation( - databaseName: String, metadata: CatalogTable) extends LeafNode with CatalogRelation { @@ -335,8 +334,4 @@ case class SimpleCatalogRelation( } dataCols ++ partCols } - - require( - metadata.identifier.database == Some(databaseName), - "provided database does not match the one specified in the table definition") } |