MaxGekk commented on a change in pull request #31206: URL: https://github.com/apache/spark/pull/31206#discussion_r560734161
########## File path: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/catalog/SessionCatalog.scala ########## @@ -170,6 +170,13 @@ class SessionCatalog( tableRelationCache.invalidate(key) } + /** Discards any cached table relation plans for the given table identifier. */ + private[sql] def invalidateCachedTable(name: TableIdentifier): Unit = { + val dbName = formatDatabaseName(name.database.getOrElse(currentDb)) + val tableName = formatTableName(name.table) + invalidateCachedTable(QualifiedTableName(dbName, tableName)) Review comment: This will not cause any correctness issue, right? ok. Look at `SessionCatalog.refreshTable`: https://github.com/apache/spark/blob/157b72ac9fa0057d5fd6d7ed52a6c4b22ebd1dfc/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/catalog/SessionCatalog.scala#L990-L1006 if `name` is a temp view, the function could invalidate a record in `tableRelationCache` for a table. but nothing bad happens, `tableRelationCache` will be filled in next time. ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org