srielau commented on code in PR #58317:
URL: https://github.com/apache/spark/pull/58317#discussion_r4134831323
##########
sql/core/src/main/scala/org/apache/spark/sql/execution/command/tables.scala:
##########
@@ -202,19 +203,31 @@ case class AlterTableRenameCommand(
} else {
val table = catalog.getTableMetadata(oldName)
DDLUtils.verifyAlterTableType(catalog, table, isView)
- // If `optStorageLevel` is defined, the old table was cached.
- val optCachedData =
sparkSession.sharedState.cacheManager.lookupCachedData(
- sparkSession.table(oldName.unquotedString))
- val optStorageLevel =
optCachedData.map(_.cachedRepresentation.cacheBuilder.storageLevel)
- if (optStorageLevel.isDefined) {
+ val cacheManager = sparkSession.sharedState.cacheManager
+ val resolver = sparkSession.sessionState.conf.resolver
+ val lookedUp = (
+ cacheManager.lookupDirectCacheDescriptorsByName(oldName.nameParts,
resolver) ++
Review Comment:
Fixed. Qualified and unqualified name predicates are evaluated in one cache
snapshot via `lookupDirectCacheDescriptorsByNames`, keeping the previous group
order and `distinct` behavior.
--
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]