LantaoJin commented on a change in pull request #27185: [SPARK-30494][SQL]
Avoid duplicated cached RDD when create or replace an existing view
URL: https://github.com/apache/spark/pull/27185#discussion_r366103678
##########
File path:
sql/core/src/main/scala/org/apache/spark/sql/execution/command/views.scala
##########
@@ -108,9 +108,16 @@ case class CreateViewCommand(
verifyTemporaryObjectsNotExists(catalog)
if (viewType == LocalTempView) {
+ if (replace && catalog.getTempView(name.table).isDefined) {
+ sparkSession.catalog.uncacheTable(name.quotedString)
Review comment:
I prefer to adding INFO log, but not removing the `uncacheTable` here,
because after replacing, there is no way to drop the old cached data.
----------------------------------------------------------------
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:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]