You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "cloud-fan (via GitHub)" <gi...@apache.org> on 2026/05/19 13:37:09 UTC

[PR] [SPARK-54119][SQL][FOLLOWUP] Format METRIC_VIEW DESCRIBE output distinctly from VIEW [spark]

cloud-fan opened a new pull request, #55983:
URL: https://github.com/apache/spark/pull/55983

   ### What changes were proposed in this pull request?
   
   `CatalogTable.toJsonLinkedHashMap` emits the view-binding fields (`View Schema Mode`, `View Catalog and Namespace`, `SQL Path`, `View Query Output Columns`, `View Original Text`) for any `isViewLike` table. After SPARK-54119 added `METRIC_VIEW` to `isViewLike`, those fields are now also emitted for metric views. None of them apply: a metric view's `viewText` is a YAML body (not a SQL query bound to a schema with schema-evolution mode), so those rows are at best inert and at worst misleading.
   
   Narrow the view-binding block to `tableType == CatalogTableType.VIEW`, and give `METRIC_VIEW` its own branch that emits just `View Text` plus a `Language: YAML` tag so consumers can dispatch on the view_text format.
   
   ### Why are the changes needed?
   
   To make `DESCRIBE TABLE EXTENDED AS JSON` output for `METRIC_VIEW` accurately reflect its YAML nature, and avoid emitting SQL-view-specific binding fields that have no meaning for a metric view.
   
   This also makes the call site fork-friendly: forks that extend `isViewLike` to include additional view-like kinds (materialized views, streaming tables, etc.) no longer accidentally inherit the SQL-view binding block for those kinds.
   
   ### Does this PR introduce _any_ user-facing change?
   
   Yes. `DESCRIBE TABLE EXTENDED AS JSON` on a `METRIC_VIEW`:
   - No longer emits `View Original Text`, `View Schema Mode`, `View Catalog and Namespace`, `SQL Path`, or `View Query Output Columns`.
   - Now emits `Language: YAML`.
   - Still emits `View Text` (the YAML body).
   
   ### How was this patch tested?
   
   Compiles cleanly. Existing `MetricViewV2CatalogSuite` covers the v2-catalog path via `DescribeV2ViewExec`, not this v1 `toJsonLinkedHashMap` path, so it is unaffected.
   
   ### Was this patch authored or co-authored using generative AI tooling?
   
   No.


-- 
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: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


Re: [PR] [SPARK-54119][SQL][FOLLOWUP] Format METRIC_VIEW DESCRIBE output distinctly from VIEW [spark]

Posted by "cloud-fan (via GitHub)" <gi...@apache.org>.
cloud-fan commented on PR #55983:
URL: https://github.com/apache/spark/pull/55983#issuecomment-4489274907

   @chenwang-databricks @dtenedor 


-- 
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: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


Re: [PR] [SPARK-54119][SQL][FOLLOWUP] Format METRIC_VIEW DESCRIBE output distinctly from VIEW [spark]

Posted by "cloud-fan (via GitHub)" <gi...@apache.org>.
cloud-fan closed pull request #55983: [SPARK-54119][SQL][FOLLOWUP] Format METRIC_VIEW DESCRIBE output distinctly from VIEW
URL: https://github.com/apache/spark/pull/55983


-- 
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: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


Re: [PR] [SPARK-54119][SQL][FOLLOWUP] Format METRIC_VIEW DESCRIBE output distinctly from VIEW [spark]

Posted by "cloud-fan (via GitHub)" <gi...@apache.org>.
cloud-fan commented on PR #55983:
URL: https://github.com/apache/spark/pull/55983#issuecomment-4498578115

   thanks for the review, merging to master/4.x/4.2!


-- 
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: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org