Skip to content

Commit 12cd598

Browse files
committed
Add comments
1 parent 7d6a554 commit 12cd598

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

sql/core/src/main/scala/org/apache/spark/sql/internal/CatalogImpl.scala

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -418,6 +418,11 @@ class CatalogImpl(sparkSession: SparkSession) extends Catalog {
418418

419419
private def uncacheView(viewDef: LogicalPlan): Unit = {
420420
try {
421+
// If view text is defined, it means we are not storing analyzed logical plan for the view
422+
// and instead its behavior follows that of a permanent view (see SPARK-33142 for more
423+
// details). Therefore, when uncaching the view we should also do in a cascade fashion, the
424+
// same way as how a permanent view is handled. This also avoids a potential issue where a
425+
// dependent view becomes invalid because of the above while its data is still cached.
421426
val viewText = viewDef match {
422427
case v: View => v.desc.viewText
423428
case _ => None

0 commit comments

Comments
 (0)