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

   ### What changes were proposed in this pull request?
   
   Add a backward-compatible `Table.displayProperties()` API whose default 
implementation returns `properties()`. Use it for metadata display commands:
   
   - `DESCRIBE TABLE EXTENDED`
   - `SHOW TBLPROPERTIES`
   - `SHOW TABLE EXTENDED`
   
   Semantic and persistence paths, including `SHOW CREATE TABLE`, continue to 
use `Table.properties()`.
   
   ### Why are the changes needed?
   
   Catalog implementations may need to expose transient, catalog-owned metadata 
such as labels alongside table properties. Returning that metadata from 
`Table.properties()` also serializes it into `SHOW CREATE TABLE`, which 
incorrectly makes display-only metadata look like persisted, reproducible DDL.
   
   The default implementation preserves existing connector behavior and binary 
compatibility, while allowing connectors to opt in to a separate display view.
   
   JIRA: https://issues.apache.org/jira/browse/SPARK-59778
   
   ### Does this PR introduce _any_ user-facing change?
   
   Yes. Connectors may override `Table.displayProperties()` so transient 
metadata appears in `DESCRIBE TABLE EXTENDED`, `SHOW TBLPROPERTIES`, and `SHOW 
TABLE EXTENDED` without appearing in `SHOW CREATE TABLE`.
   
   Existing connectors are unchanged because the new method defaults to 
`properties()`.
   
   ### How was this patch tested?
   
   Added a test that verifies persisted and display-only properties across all 
three display commands, and verifies that `SHOW CREATE TABLE` excludes the 
display-only property.
   
   ```
   SPARK_LOCAL_IP=localhost build/sbt "sql/testOnly 
org.apache.spark.sql.execution.command.v2.DescribeTableSuite 
org.apache.spark.sql.execution.command.v2.ShowTblPropertiesSuite 
org.apache.spark.sql.execution.command.v2.ShowTablesSuite"
   ```
   
   All 74 tests passed.
   
   ```
   build/sbt "catalyst/mimaReportBinaryIssues"
   ```
   
   MiMa passed.
   
   ### Was this patch authored or co-authored using generative AI tooling?
   
   Generated-by: 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