szehon-ho opened a new pull request, #58092:
URL: https://github.com/apache/spark/pull/58092

   ### What changes were proposed in this pull request?
   
   Make `DESCRIBE TABLE` tolerate inconsistent partition metadata. If a table's 
declared partition
   columns do not match the trailing fields in its schema, omit the invalid 
partition-information
   section while continuing to return the table schema and detailed table 
metadata.
   
   Add a regression test that creates a `CatalogTable` with mismatched schema 
and partition column
   names and verifies that `DESCRIBE TABLE EXTENDED` still returns useful 
results.
   
   
   ### Why are the changes needed?
   
   `DescribeTableCommand.describePartitionInfo` directly calls 
`CatalogTable.partitionSchema`, which
   asserts that the schema's trailing fields match `partitionColumnNames`. 
Corrupt catalog metadata
   therefore causes `DESCRIBE TABLE` itself to fail with an `AssertionError`, 
preventing users from
   inspecting the remaining metadata that may help diagnose or repair the table.
   
   
   ### Does this PR introduce _any_ user-facing change?
   
   Yes. Previously, `DESCRIBE TABLE` failed with an `AssertionError` for 
inconsistent partition
   metadata. It now returns the valid table information and omits the invalid 
partition-information
   section.
   
   
   ### How was this patch tested?
   
   Added a focused regression test to
   `org.apache.spark.sql.execution.command.v1.DescribeTableSuite`.
   
   `git diff --check` passes. The focused SBT test was attempted, but this 
environment has Java 11
   while Spark master requires Java 17.0.11 or later; dependency resolution was 
also unavailable due
   to DNS failures reaching Maven Central.
   
   
   ### Was this patch authored or co-authored using generative AI tooling?
   
   Generated-by: OpenAI Codex (GPT-5).
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to