linhongliu-db opened a new pull request, #57362:
URL: https://github.com/apache/spark/pull/57362

   ### What changes were proposed in this pull request?
   
   This follow-up updates `SHOW TABLE EXTENDED ... AS JSON` for V2 catalogs to 
use catalog-provided summary metadata when producing extended JSON rows.
   
   - For V2 relation catalogs, extended JSON now uses 
`RelationCatalog#listRelationSummaries`, so relations such as views are 
preserved.
   - For V2 table catalogs, extended JSON now uses 
`TableCatalog#listTableSummaries`.
   - The extended JSON `type` field now comes from `TableSummary.tableType()` 
instead of being hard-coded to `TABLE`.
   - V2 command-suite coverage now checks the V2 summary table type and covers 
a relation catalog returning both a table and a view.
   
   ### Why are the changes needed?
   
   `SHOW TABLE EXTENDED` text output uses V2 summary metadata for table type 
information, but the JSON path was falling back to identifier-only table 
listing and hard-coding the type as `TABLE`. That loses V2 table type metadata, 
and for relation catalogs it can also miss V2 views that are available through 
relation summaries.
   
   ### Does this PR introduce _any_ user-facing change?
   
   Yes. On unreleased Spark master, `SHOW TABLE EXTENDED ... AS JSON` for V2 
catalogs now reports the catalog-provided table or view type metadata and 
preserves V2 relation-catalog views in the JSON output.
   
   ### How was this patch tested?
   
   Added regression coverage in `ShowTablesSuite`.
   
   Also checked:
   
   ```
   git diff --check apache/master..HEAD
   ```
   
   Attempted local Spark SQL suite validation, but the environment could not 
download required build dependencies:
   
   ```
   ./build/sbt "sql/testOnly 
org.apache.spark.sql.execution.command.v2.ShowTablesSuite -- -z 'show table 
extended as json returns relation catalog table and view types'"
   ./build/mvn -pl sql/core -am -DskipTests -DskipJavaTests -DskipScalaTests 
-DskipMima -DskipCheckstyle test-compile
   MAVEN_MIRROR_URL=https://repo.maven.apache.org/maven2 ./build/mvn -pl 
sql/core -am -DskipTests -DskipJavaTests -DskipScalaTests -DskipMima 
-DskipCheckstyle test-compile
   ```
   
   ### 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