(feat: persistence) Add schema-metrics-v1.sql for metrics tables (#3337)#3523
(feat: persistence) Add schema-metrics-v1.sql for metrics tables (#3337)#3523dimas-b merged 1 commit intoapache:mainfrom
Conversation
persistence/relational-jdbc/src/main/resources/postgres/schema-v4.sql
Outdated
Show resolved
Hide resolved
persistence/relational-jdbc/src/main/resources/postgres/schema-v4.sql
Outdated
Show resolved
Hide resolved
|
@obelix74 @singhpk234 : WDYT about starting an RFC doc + |
|
@dimas-b there is a dev thread already please ref : https://lists.apache.org/thread/c83jnkvlwc2k3swm65cmvl4t0mt7p799 |
I am trying to solve two sets of asks from my product folks with this.
From the metrics perspective, today, with Track table scan operations:
For commit report queries:
Also many operational dashboards, and filtering by user, realm, engine name, version etc. I have not thought about roles in this flow at all, perhaps it will be useful. @singhpk234 recommended adding roles and I added them. I normalized the roles tables from a RDBMS perspective, but I didn't realize there are other similar fields stored as JSON already. |
|
@obelix74 : please rebase to fix CI |
|
Let's hold final review until #3616 is resolved... Intermediate comments are welcome, of course :) |
7771396 to
65e8cb4
Compare
persistence/relational-jdbc/src/main/resources/postgres/schema-metrics-v1.sql
Outdated
Show resolved
Hide resolved
...rc/main/java/org/apache/polaris/persistence/relational/jdbc/JdbcMetaStoreManagerFactory.java
Show resolved
Hide resolved
dimas-b
left a comment
There was a problem hiding this comment.
LGTM. Let's give this PR a couple more days in review for other people to comment if they want.
...rc/main/java/org/apache/polaris/persistence/relational/jdbc/JdbcMetaStoreManagerFactory.java
Show resolved
Hide resolved
...lational-jdbc/src/main/java/org/apache/polaris/persistence/relational/jdbc/DatabaseType.java
Show resolved
Hide resolved
persistence/relational-jdbc/src/main/resources/postgres/schema-metrics-v1.sql
Outdated
Show resolved
Hide resolved
persistence/relational-jdbc/src/main/resources/h2/schema-metrics-v1.sql
Outdated
Show resolved
Hide resolved
runtime/admin/src/main/java/org/apache/polaris/admintool/BootstrapCommand.java
Show resolved
Hide resolved
persistence/relational-jdbc/src/main/resources/h2/schema-metrics-v1.sql
Outdated
Show resolved
Hide resolved
dimas-b
left a comment
There was a problem hiding this comment.
LGTM 👍
@singhpk234 : WDYT?
persistence/relational-jdbc/src/main/resources/postgres/schema-metrics-v1.sql
Outdated
Show resolved
Hide resolved
polaris-core/src/main/java/org/apache/polaris/core/persistence/MetaStoreManagerFactory.java
Outdated
Show resolved
Hide resolved
.../org/apache/polaris/persistence/relational/jdbc/RelationalJdbcProductionReadinessChecks.java
Outdated
Show resolved
Hide resolved
…tation Add checkMetricsPersistenceBootstrapped() to RelationalJdbcProductionReadinessChecks that properly verifies the MetricsPersistence implementation as requested in PR apache#3523. The check verifies: 1. The MetricsPersistence implementation is JdbcMetricsPersistence (not NoOpMetricsPersistence) 2. The JdbcMetricsPersistence.supportsMetricsPersistence() returns true (schema >= v4) This addresses the PR comment from dimas-b suggesting we should test the actual Metrics Persistence implementation rather than just checking configuration flags.
df4d3e7 to
ff9d552
Compare
This commit adds database schema support for metrics persistence tables as part of the JDBC persistence backend. Key changes: - schema-metrics-v1.sql for PostgreSQL and H2 with metrics tables - DatabaseType: Add metrics schema resource path support - JdbcBasePersistenceImpl: Add metrics schema bootstrap capability - JdbcBootstrapUtils: Support for metrics schema initialization - QueryGenerator: Add metrics-related query generation - SchemaOptions: Add metrics schema option for bootstrap command - BootstrapCommand: Support --metrics flag for schema bootstrap Testing: - MetricsPersistenceBootstrapValidationTest: Validates schema bootstrap - JdbcBootstrapUtilsTest: Tests for bootstrap utilities - QueryGeneratorTest: Tests for metrics query generation
3e553a3 to
64dca5c
Compare
Add new schema version 4 with tables for storing scan and commit metrics reports as first-class entities.
New tables:
Key design decisions:
Checklist
CHANGELOG.md(if needed)site/content/in-dev/unreleased(if needed)