Changes

Summary

  1. [SPARK-37098][SQL][3.0] Alter table properties should invalidate cache (details)
Commit 21862951eac0d0eb2df4670201ba6435fe427e7e by dongjoon
[SPARK-37098][SQL][3.0] Alter table properties should invalidate cache

This PR backport https://github.com/apache/spark/pull/34365 to branch-3.0

### What changes were proposed in this pull request?

Invalidate the table cache after alter table properties (set and unset).

### Why are the changes needed?

The table properties can change the behavior of wriing. e.g. the parquet table with `parquet.compression`.

If you execute the following SQL, we will get the file with snappy compression rather than zstd.
```
CREATE TABLE t (c int) STORED AS PARQUET;
// cache table metadata
SELECT * FROM t;
ALTER TABLE t SET TBLPROPERTIES('parquet.compression'='zstd');
INSERT INTO TABLE t values(1);
```
So we should invalidate the table cache after alter table properties.

### Does this PR introduce _any_ user-facing change?

yes, bug fix

### How was this patch tested?

Add test

Closes #34379 from ulysses-you/SPARK-37098-3.0.

Authored-by: ulysses-you <ulyssesyou18@gmail.com>
Signed-off-by: Dongjoon Hyun <dongjoon@apache.org>
The file was modifiedsql/hive/src/test/scala/org/apache/spark/sql/hive/HiveParquetSuite.scala (diff)
The file was modifiedsql/core/src/main/scala/org/apache/spark/sql/execution/command/ddl.scala (diff)
The file was modifiedsql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/catalog/SessionCatalog.scala (diff)