Skip to content

[#12385] feat(api): Add structured Metric View Java API - #12386

Draft
mchades wants to merge 1 commit into
apache:mainfrom
mchades:metric-view-api
Draft

[#12385] feat(api): Add structured Metric View Java API#12386
mchades wants to merge 1 commit into
apache:mainfrom
mchades:metric-view-api

Conversation

@mchades

@mchades mchades commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

Add the public Java API for structured Metric Views described in #12360:

  • Introduce MetricRepresentation and OSI-compatible semantic model types.
  • Add string-based MetricDialects constants and immutable builders.
  • Add View#metricRepresentation() and ViewCatalog#createMetricView().
  • Add API unit tests for the new types and helpers.

Why are the changes needed?

Gravitino needs a typed public contract for representing Metric Views through the existing View lifecycle. This PR establishes the Java API layer; REST, persistence, clients, server-side validation, and query execution are outside its scope.

Fix: #12385

Does this PR introduce any user-facing change?

Yes. It adds new @Unstable public Java APIs for creating and reading structured Metric Views.

How was this patch tested?

  • ./gradlew :api:test :api:javadoc :api:spotlessCheck

@github-actions

github-actions Bot commented Aug 6, 2026

Copy link
Copy Markdown

Code Coverage Report

Overall Project 68.32% +0.01% 🟢
Files changed 71.11% 🟢

Module Coverage
aliyun 1.72% 🔴
api 51.36% +2.0% 🟢
authorization-common 85.96% 🟢
aws 42.04% 🟢
azure 2.47% 🔴
catalog-common 9.92% 🔴
catalog-fileset 79.74% 🟢
catalog-glue 68.95% 🟢
catalog-hive 79.4% 🟢
catalog-jdbc-common 45.7% 🟢
catalog-jdbc-doris 81.8% 🟢
catalog-jdbc-mysql 79.33% 🟢
catalog-jdbc-postgresql 83.39% 🟢
catalog-jdbc-starrocks 79.16% 🟢
catalog-kafka 77.01% 🟢
catalog-lakehouse-generic 59.18% 🟢
catalog-lakehouse-hudi 79.1% 🟢
catalog-lakehouse-iceberg 85.86% 🟢
catalog-lakehouse-paimon 84.23% 🟢
catalog-model 77.72% 🟢
cli 44.48% 🟢
client-java 78.27% 🟢
common 52.57% 🟢
core 83.2% 🟢
filesystem-hadoop3 77.28% 🟢
flink 0.0% 🔴
flink-common 48.68% 🟢
flink-runtime 0.0% 🔴
gcp 14.12% 🔴
hadoop-auth 68.0% 🟢
hadoop-common 12.7% 🔴
hive-metastore-common 53.4% 🟢
iceberg-common 64.75% 🟢
iceberg-rest-server 75.1% 🟢
idp-basic 86.02% 🟢
integration-test-common 0.0% 🔴
jobs 62.92% 🟢
lance-common 31.75% 🔴
lance-rest-server 63.47% 🟢
lineage 53.02% 🟢
optimizer 83.24% 🟢
optimizer-api 21.95% 🔴
server 85.88% 🟢
server-common 76.45% 🟢
spark 28.57% 🔴
spark-common 45.89% 🟢
tencent 69.84% 🟢
trino-connector 40.29% 🟢
Files
Module File Coverage
api SemanticModel.java 96.08% 🟢
SemanticModelUtils.java 95.24% 🟢
MetricRepresentation.java 88.89% 🟢
View.java 84.21% 🟢
Dataset.java 77.97% 🟢
AIContext.java 74.47% 🟢
Field.java 71.43% 🟢
CustomExtension.java 63.64% 🟢
DialectExpression.java 63.64% 🟢
Relationship.java 58.18% 🔴
Metric.java 51.28% 🔴
Dimension.java 50.0% 🔴
Expression.java 50.0% 🔴
ViewCatalog.java 22.22% 🔴
Representation.java 0.0% 🔴
MetricDialects.java 0.0% 🔴

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Subtask] Add Metric View Java API in Gravitino

1 participant