feat(optimizer): [1/N] Optimizer Repository#530
feat(optimizer): [1/N] Optimizer Repository#530mkuchenbecker wants to merge 4 commits intomkuchenb/optimizer-0from
Conversation
Spring Data JPA repositories for all four optimizer tables with filtered query support. Includes tests exercising save/find, filtered queries, upsert semantics, and append-only history. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Address PR review comments: rename findFiltered → find across all repos, remove redundant findByTableUuid/findByTableUuidSince from history repos, add explicit assertion to context test. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Shared JPA entities and repositories for optimizer apps (analyzer, scheduler). All repos expose a single find method with optional filters. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Propagate CompleteOperationRequest orphan field removal. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
| @Column(name = "id", nullable = false, length = 36) | ||
| private String id; | ||
|
|
||
| @Column(name = "table_uuid", nullable = false, length = 36) |
There was a problem hiding this comment.
It would be good to capture databaseId and tableId for getting historical insights on table operations.
There was a problem hiding this comment.
Claude: Added databaseName and tableName columns (both VARCHAR(128)) to TableOperationHistoryRow in commit 027fccd6. The underlying schema already carries them, so this is purely an entity-level addition that lets analyst-style queries read the history without joining back to table_operations.
|
|
||
| dependencies { | ||
| implementation 'org.springframework.boot:spring-boot-starter-data-jpa:2.7.8' | ||
| implementation 'com.vladmihalcea:hibernate-types-55:2.21.1' |
There was a problem hiding this comment.
Where exactly this dependency is used? Seems like new dependency.
There was a problem hiding this comment.
Claude: It is used by TableStatsRow in this shared module. The @TypeDef(name = "json", typeClass = JsonStringType.class) and @Type(type = "json") annotations on TableStatsRow.stats and TableStatsRow.tableProperties resolve to com.vladmihalcea.hibernate.type.json.JsonStringType, which lives in this dependency. It is the same library already used by services/optimizer for the same purpose.
…y row Address PR linkedin#530 review feedback: the lightweight read-side TableOperationHistoryRow in the apps/optimizer shared module did not surface the denormalized database_name and table_name columns, even though the underlying schema carries them. Add them so analyst-style queries from the analyzer/scheduler side can read operation history without joining back to table_operations. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Optimizer Stack
Summary
PR 1 of N in the optimizer stack.
Overall Project
Service Design doc.
Spring Data JPA repositories for all four optimizer tables with filtered query support, plus tests exercising save/find, filtered queries, upsert semantics, and append-only history.
Changes
Repositories:
TableOperationsRepository,TableOperationsHistoryRepository,TableStatsRepository,TableStatsHistoryRepository— each with JPQL filtered query methods.Tests: Repository tests for all four tables plus
OptimizerServiceContextTestverifying the Spring context loads.Testing Done
./gradlew :services:optimizer:test— all tests pass (H2 in MySQL mode).Additional Information