-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-54028][SQL] Use empty schema when altering a view which is not Hive compatible #52730
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cloud-fan
reviewed
Oct 30, 2025
sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveExternalCatalog.scala
Show resolved
Hide resolved
cloud-fan
reviewed
Oct 30, 2025
sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveExternalCatalog.scala
Outdated
Show resolved
Hide resolved
cloud-fan
reviewed
Oct 30, 2025
sql/hive/src/test/scala/org/apache/spark/sql/hive/HiveMetastoreCatalogSuite.scala
Show resolved
Hide resolved
…Catalog.scala Co-authored-by: Wenchen Fan <cloud0fan@gmail.com>
cloud-fan
reviewed
Oct 31, 2025
sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveExternalCatalog.scala
Outdated
Show resolved
Hide resolved
cloud-fan
approved these changes
Oct 31, 2025
cloud-fan
approved these changes
Oct 31, 2025
Contributor
|
thanks, merging to master/4.0! |
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>
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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