Skip to content

Conversation

@cravani
Copy link
Contributor

@cravani cravani commented Oct 25, 2025

What changes were proposed in this pull request?

Spark attempts to save views in a Hive-compatible format and only sets the schema to empty if the save operation fails.

However, due to certain Hive compatibility issues, the save operation may succeed while subsequent read operations fail. This issue arises after the change introduced in SPARK-46934, which removed the verifyColumnDataType check during the ALTER TABLE operation.

Why are the changes needed?

to not save malformed views that no one can read.

Does this PR introduce any user-facing change?

Yes, the malformed view will be saved in non hive compatible way so that Spark can read it.

How was this patch tested?

Updated Test case

Was this patch authored or co-authored using generative AI tooling?

No

@github-actions github-actions bot added the SQL label Oct 25, 2025
@HyukjinKwon HyukjinKwon changed the title SPARK-54028: Use empty schema when altering a view which is not Hive compatible [SPARK-54028][SQL] Use empty schema when altering a view which is not Hive compatible Oct 26, 2025
…Catalog.scala

Co-authored-by: Wenchen Fan <cloud0fan@gmail.com>
@cloud-fan
Copy link
Contributor

cloud-fan commented Oct 31, 2025

thanks, merging to master/4.0!

@cloud-fan cloud-fan closed this in 3d292dc Oct 31, 2025
cloud-fan pushed a commit that referenced this pull request Oct 31, 2025
… Hive compatible

### What changes were proposed in this pull request?
Spark attempts to save views in a Hive-compatible format and only sets the schema to empty if the save operation fails.

However, due to certain Hive compatibility issues, the save operation may succeed while subsequent read operations fail. This issue arises after the change introduced in [SPARK-46934](https://issues.apache.org/jira/browse/SPARK-46934), which removed the verifyColumnDataType check during the ALTER TABLE operation.

### Why are the changes needed?
to not save malformed views that no one can read.

### Does this PR introduce _any_ user-facing change?
Yes, the malformed view will be saved in non hive compatible way so that Spark can read it.

### How was this patch tested?
Updated Test case

### Was this patch authored or co-authored using generative AI tooling?
No

Closes #52730 from cravani/SPARK-54028.

Authored-by: Chiran Ravani <chiran54321@gmail.com>
Signed-off-by: Wenchen Fan <wenchen@databricks.com>
(cherry picked from commit 3d292dc)
Signed-off-by: Wenchen Fan <wenchen@databricks.com>
@cravani cravani deleted the SPARK-54028 branch October 31, 2025 19:08
huangxiaopingRD pushed a commit to huangxiaopingRD/spark that referenced this pull request Nov 25, 2025
… Hive compatible

### What changes were proposed in this pull request?
Spark attempts to save views in a Hive-compatible format and only sets the schema to empty if the save operation fails.

However, due to certain Hive compatibility issues, the save operation may succeed while subsequent read operations fail. This issue arises after the change introduced in [SPARK-46934](https://issues.apache.org/jira/browse/SPARK-46934), which removed the verifyColumnDataType check during the ALTER TABLE operation.

### Why are the changes needed?
to not save malformed views that no one can read.

### Does this PR introduce _any_ user-facing change?
Yes, the malformed view will be saved in non hive compatible way so that Spark can read it.

### How was this patch tested?
Updated Test case

### Was this patch authored or co-authored using generative AI tooling?
No

Closes apache#52730 from cravani/SPARK-54028.

Authored-by: Chiran Ravani <chiran54321@gmail.com>
Signed-off-by: Wenchen Fan <wenchen@databricks.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants