diff options
Diffstat (limited to 'sql/catalyst')
3 files changed, 4 insertions, 5 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 e1d49912c3..ffaefeb09a 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 @@ -403,7 +403,7 @@ class SessionCatalog( val relation = if (name.database.isDefined || !tempTables.contains(table)) { val metadata = externalCatalog.getTable(db, table) - SimpleCatalogRelation(db, metadata, alias) + SimpleCatalogRelation(db, metadata) } else { tempTables(table) } 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 6197acab33..b12606e17d 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 @@ -244,8 +244,7 @@ trait CatalogRelation { */ case class SimpleCatalogRelation( databaseName: String, - metadata: CatalogTable, - alias: Option[String] = None) + metadata: CatalogTable) extends LeafNode with CatalogRelation { override def catalogTable: CatalogTable = metadata @@ -261,7 +260,7 @@ case class SimpleCatalogRelation( CatalystSqlParser.parseDataType(f.dataType), // Since data can be dumped in randomly with no validation, everything is nullable. nullable = true - )(qualifier = Some(alias.getOrElse(metadata.identifier.table))) + )(qualifier = Some(metadata.identifier.table)) } } diff --git a/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/catalog/SessionCatalogSuite.scala b/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/catalog/SessionCatalogSuite.scala index c8e7c5103b..05eb302c3c 100644 --- a/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/catalog/SessionCatalogSuite.scala +++ b/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/catalog/SessionCatalogSuite.scala @@ -407,7 +407,7 @@ class SessionCatalogSuite extends SparkFunSuite { val relationWithAlias = SubqueryAlias(alias, SubqueryAlias("tbl1", - SimpleCatalogRelation("db2", tableMetadata, Some(alias)))) + SimpleCatalogRelation("db2", tableMetadata))) assert(catalog.lookupRelation( TableIdentifier("tbl1", Some("db2")), alias = None) == relation) assert(catalog.lookupRelation( |