cloud-fan commented on code in PR #37021:
URL: https://github.com/apache/spark/pull/37021#discussion_r910661173
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/catalog/InMemoryCatalog.scala:
##########
@@ -343,7 +343,9 @@ class InMemoryCatalog(
override def getTable(db: String, table: String): CatalogTable =
synchronized {
requireTableExists(db, table)
- catalog(db).tables(table).table
+ val catalogTable = catalog(db).tables(table).table
+ val catalogOption =
CatalystIdentifier.sessionCatalogOption(catalogTable.identifier.database)
+ catalogTable.copy(identifier = catalogTable.identifier.copy(catalog =
catalogOption))
Review Comment:
The benefit is we can make the code safer: we should not overwrite the
catalog field if it's already specified.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]