This is an automated email from the ASF dual-hosted git repository.

yao pushed a commit to branch branch-3.1
in repository https://gitbox.apache.org/repos/asf/spark.git


The following commit(s) were added to refs/heads/branch-3.1 by this push:
     new 05aea97  Revert "[SPARK-37098][SQL] Alter table properties should 
invalidate cache"
05aea97 is described below

commit 05aea976873e3ca55251f8e6c7e38fa5ae7e8c91
Author: Kent Yao <y...@apache.org>
AuthorDate: Tue Oct 26 11:10:10 2021 +0800

    Revert "[SPARK-37098][SQL] Alter table properties should invalidate cache"
    
    This reverts commit 286a37663213ef3abfbf9effb8cd5723ec6382ff.
---
 .../apache/spark/sql/execution/command/ddl.scala   |  2 --
 .../apache/spark/sql/hive/HiveParquetSuite.scala   | 24 ----------------------
 2 files changed, 26 deletions(-)

diff --git 
a/sql/core/src/main/scala/org/apache/spark/sql/execution/command/ddl.scala 
b/sql/core/src/main/scala/org/apache/spark/sql/execution/command/ddl.scala
index 4512a3d0..8722831 100644
--- a/sql/core/src/main/scala/org/apache/spark/sql/execution/command/ddl.scala
+++ b/sql/core/src/main/scala/org/apache/spark/sql/execution/command/ddl.scala
@@ -277,7 +277,6 @@ case class AlterTableSetPropertiesCommand(
       properties = table.properties ++ properties,
       comment = 
properties.get(TableCatalog.PROP_COMMENT).orElse(table.comment))
     catalog.alterTable(newTable)
-    catalog.invalidateCachedTable(tableName)
     Seq.empty[Row]
   }
 
@@ -316,7 +315,6 @@ case class AlterTableUnsetPropertiesCommand(
     val newProperties = table.properties.filter { case (k, _) => 
!propKeys.contains(k) }
     val newTable = table.copy(properties = newProperties, comment = 
tableComment)
     catalog.alterTable(newTable)
-    catalog.invalidateCachedTable(tableName)
     Seq.empty[Row]
   }
 
diff --git 
a/sql/hive/src/test/scala/org/apache/spark/sql/hive/HiveParquetSuite.scala 
b/sql/hive/src/test/scala/org/apache/spark/sql/hive/HiveParquetSuite.scala
index a5a3367..df96b06 100644
--- a/sql/hive/src/test/scala/org/apache/spark/sql/hive/HiveParquetSuite.scala
+++ b/sql/hive/src/test/scala/org/apache/spark/sql/hive/HiveParquetSuite.scala
@@ -123,28 +123,4 @@ class HiveParquetSuite extends QueryTest with ParquetTest 
with TestHiveSingleton
       assert(msg.contains("cannot resolve '`c3`' given input columns"))
     }
   }
-
-  test("SPARK-37098: Alter table properties should invalidate cache") {
-    // specify the compression in case we change it in future
-    withSQLConf(SQLConf.PARQUET_COMPRESSION.key -> "snappy") {
-      withTempPath { dir =>
-        withTable("t") {
-          sql(s"CREATE TABLE t (c int) STORED AS PARQUET LOCATION 
'${dir.getCanonicalPath}'")
-          // cache table metadata
-          sql("SELECT * FROM t")
-          sql("ALTER TABLE t SET TBLPROPERTIES('parquet.compression'='zstd')")
-          sql("INSERT INTO TABLE t values(1)")
-          val files1 = 
dir.listFiles().filter(_.getName.endsWith("zstd.parquet"))
-          assert(files1.length == 1)
-
-          // cache table metadata again
-          sql("SELECT * FROM t")
-          sql("ALTER TABLE t UNSET TBLPROPERTIES('parquet.compression')")
-          sql("INSERT INTO TABLE t values(1)")
-          val files2 = 
dir.listFiles().filter(_.getName.endsWith("snappy.parquet"))
-          assert(files2.length == 1)
-        }
-      }
-    }
-  }
 }

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@spark.apache.org
For additional commands, e-mail: commits-h...@spark.apache.org

Reply via email to