Skip to content
Lucas Lessa
Voltar para as notícias
DatabricksGAImpacto: Médio

Databricks now allows sharing metric views via OpenSharing

Sharing metric views using OpenSharing is now generally available (GA). Add metric views to a share and query them using MEASURE(...).

O que mudou

Sharing metric views with OpenSharing is now generally available, enabling organizations to include metric views in Unity Catalog shares and query them externally.

Use cases

Imagine that you have defined centralized business metrics in a metric view and need to distribute them to external recipients or different business units. With this feature, you can:

  • Add metric views to an OpenSharing share.
  • Enable recipients to query business metrics using standardized definitions.
  • Execute queries on shared metric views using serverless compute.

How to use

To add a metric view to a share, run the SQL command in a Databricks notebook or the Databricks SQL query editor:

ALTER SHARE my_share ADD TABLE my_catalog.my_schema.my_metric_view;

What happens in this code:

  1. The ALTER SHARE command targets the specified sharing object.
  2. The ADD TABLE clause appends the metric view asset to the share collection.
  3. The metric view becomes available to authorized recipients.

To query the shared metric view on the recipient side using serverless compute:

SELECT MEASURE(my_metric) FROM my_share.my_schema.my_metric_view;

What happens in this code:

  1. The query executes against the external share using serverless compute.
  2. The MEASURE(...) function evaluates the aggregated metric defined in the shared view.

Limitations and requirements

  • Maturity: Generally Available (GA).
  • Querying shared metric views requires serverless compute.
  • Requires appropriate Unity Catalog privileges, such as being the share owner and holding USE CATALOG, USE SCHEMA, and SELECT permissions on the source asset.
Ver nota oficial do Databricks

Sharing metric views with OpenSharing is now generally available

Resumo e explicação gerados por IA a partir da release note oficial. Em caso de dúvida, a documentação oficial da plataforma prevalece.

Relacionadas