SPI foundation: replace java.sql.Connection with DeploymentContext - #240
Merged
Conversation
jogrogan
force-pushed
the
jogrogan/decouple-pr1-spi
branch
from
July 27, 2026 19:44
25693de to
a4b5fff
Compare
Introduce a neutral DeploymentContext SPI and migrate the deploy/validate machinery (Deployer/Validator/Connector/Config providers) plus all deployers off java.sql.Connection. Adds CalciteDeploymentContext (SQL path), DualLogger (extracted from HoptimatorConnection), SimpleDeploymentContext, and makes databaseProperties' catalog/schema optional. The SQL/DDL path is fully on DeploymentContext; no direct table API or Avro preservation yet. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
jogrogan
force-pushed
the
jogrogan/decouple-pr1-spi
branch
from
July 27, 2026 20:19
a4b5fff to
da168a3
Compare
ryannedolan
approved these changes
Jul 27, 2026
Comment on lines
+122
to
+123
| * Builds the effective JDBC URL for a Database: its CRD {@code url} with the connection-level | ||
| * properties (except {@code user}/{@code password}) and the CRD name appended as |
Collaborator
There was a problem hiding this comment.
Claude loves to conflate CRD with CR (everyone does).
Collaborator
Author
There was a problem hiding this comment.
Yea that's fair, did a quick check and it seems to be conflating in a bunch of spots, many already checked in. I'll try to clean it up separate from this.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Decouple Proteus DDL
Hoptimator's validation and deployment logic is currently reachable only by issuing SQL DDL through a Calcite/JDBC connection. That couples every caller to Calcite and forces schema definitions through a lossy Avro → RelDataType → Avro round-trip. Hoptimator via a CLI or over REST/gRPC may want to create/validate tables by handing us a table name + a schema directly — not by constructing DDL.
This stacked series decouples the validators and deployers from Calcite so the same validation and deployment engine can be driven either by SQL or by a direct, connection-free call — while keeping validators/deployers as a clean SPI. The payoff: an API call to "create table from a schema" path with identical guarantees to DDL (including dry-run), lossless Avro fidelity, and no Calcite dependency for callers that don't want one. It also keeps the door open for follow-ups (e.g. materializations, source→sink field mappings) without re-plumbing.
Stacked series (review/merge in order):
(This is PR 1 of 3.)
PR 1/3 — SPI foundation: replace
java.sql.ConnectionwithDeploymentContextToday the deploy/validate SPI is threaded with
java.sql.Connection, which hard-wires thecontrol plane to Calcite/JDBC. That makes it impossible to drive table validation and
creation any way other than through a JDBC connection running DDL. This PR introduces a
neutral seam —
DeploymentContext— and moves the entire SPI and every deployer offjava.sql.Connection, without changing any behavior. It is pure decoupling: theSQL/DDL path works exactly as before, just over the new context instead of a connection.
This is the groundwork for a SQL-free, connection-free table API (PR2), which in turn
lets callers (e.g. a gRPC service) request the same validation + deployment from a table
path and a schema rather than by issuing DDL.
What changes
DeploymentContext(hoptimator-api) — the connection-free handle thedeploy/validate machinery now depends on, replacing
java.sql.ConnectionacrossDeployer,Validator,Connector, and the*Providerinterfaces.CalciteDeploymentContext— the SQL-path implementation that adapts the existingCalcite/JDBC world onto
DeploymentContext, so the DDL path is unchanged.DualLoggerextracted fromHoptimatorConnection— log-hook fan-out is no longertied to the connection object.
SimpleDeploymentContext— a minimal context for connection-free control-planecallers.
databaseProperties(...)now takes optionalcatalog/schema, so config resolutionno longer assumes a fully-qualified JDBC identifier.
java.sql.Connection— K8s (and its YAML/job/source/MVdeployers), Kafka, MySQL, Venice, and the logical-table deployer — plus the
Config/Connector/Validatorproviders.HoptimatorDdlUtilsrefactored to drive deployment through the context rather than theconnection.
What this PR does not do
Testing
DualLoggerTest,SimpleDeploymentContextTest,TestDeploymentContext).Review notes
Connection → DeploymentContextsignature swaps in deployers/providers and their tests.
DeploymentContext,CalciteDeploymentContext,DualLogger, andthe
HoptimatorDdlUtilsrefactor; the rest follows from those.docs/extending/validators.md.