feat: Extract sqrl-planner-model module for plan file model classes - #2237
Closed
velo wants to merge 2 commits into
Closed
feat: Extract sqrl-planner-model module for plan file model classes#2237velo wants to merge 2 commits into
velo wants to merge 2 commits into
Conversation
Signed-off-by: Marvin Froeder <marvin@datasqrl.com>
Signed-off-by: Marvin Froeder <marvin@datasqrl.com>
Collaborator
Author
|
Closing in favour of #2238, which does the same extraction and additionally fixes the |
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.
Why
Consumers that only need to read or write DataSQRL's output files (
postgres.json,kafka.json,flink.json,pipeline_mutation_database.json) currently have to depend onsqrl-planner, which drags in Calcite, Flink and the whole compiler. This extracts those model classes into a new module whose only dependencies arejackson-annotationsandjackson-databind(plus provided Lombok).What
New
sqrl-planner-modelmodule, packages unchanged so nothing else had to re-import:EnginePhysicalPlan+DeploymentArtifact/ArtifactType— the Flink-onlytoYamlStringhelper moved toFlinkPhysicalPlan, its sole callerJdbcPlan(new) — the JDBC plan files, withgetStatementsForTypeand the schema/views artifact logicJdbcStatement,GenericJdbcStatement,CreateTableJdbcStatementKafkaPhysicalPlan+NewTopicFlinkPlan(new)MutationDatabase+ nestedTable/TableDefinition/ColumnDefinitionCombinedEnginePlan,StreamPhysicalPlan,DatabasePhysicalPlan,EngineCreateTableHow the entangled classes were split
FlinkPhysicalPlanandJdbcPhysicalPlanstay in the planner — they carryRelNode/Configurationworking state — but now serialize through@JsonValue toModel()delegating toFlinkPlan/JdbcPlan. The model classes are the single source of truth for the file format, so the two cannot drift.GenericJdbcStatementlost a write-onlyRelDataTypefieldCreateTableJdbcStatement.engineTablewidened to theEngineCreateTablemarker, with three casts at planner read sitesMutationDatabase's planner-heavy statics moved to a new planner-sideMutationDatabaseshelperConfigLoaderUtils.loadPostgresPhysicalPlannow returnsJdbcPlanNot included
ServerPhysicalPlancontent (theserver-model.jsonshapes already live in the slimsqrl-server-core) andPostgresLogPhysicalPlan(its entries compute SQL from Calcite nodes at write time and are never deserialized).Testing
New
PlanModelSerializationTestpins the emitted field set for both plan types and round-tripspostgres.jsonthroughJdbcPlan, guarding the file format against drift. Full reactormvn testpasses; snapshots are unaffected because the serialized JSON is byte-identical.🤖 Generated with Claude Code