feat: rocky preview create executes copy-from-base — Phase 1.5#282
Merged
hugocorreia90 merged 1 commit intomainfrom Apr 29, 2026
Merged
feat: rocky preview create executes copy-from-base — Phase 1.5#282hugocorreia90 merged 1 commit intomainfrom
hugocorreia90 merged 1 commit intomainfrom
Conversation
Lifts run_preview_create from planning-only to actual copy execution.
For each copy-set model, builds the AdapterRegistry from rocky.toml,
resolves the source schema from the model sidecar, then issues:
CREATE SCHEMA IF NOT EXISTS branch_schema
CREATE OR REPLACE TABLE branch_schema.<model> AS
SELECT * FROM source_schema.<model>
through WarehouseAdapter::execute_statement. Per-model failures (model
missing in base, schema mismatch) surface as copy_strategy = "failed"
without aborting — the rest of the copy set still runs so the PR-comment
surface stays informative. Registry-build failures fall back to
planning_only entries (the prune-set decision still ships).
Why no new trait method: WarehouseAdapter::execute_statement already
covers the CTAS surface. Introducing clone_table_from on the trait
would block the Phase 5 native-clone landing on a wider refactor.
That trait method lands when Phase 5 ships SHALLOW CLONE / zero-copy
CLONE adapter implementations with CTAS as the default impl.
2 new tests:
- copy_from_base_executes_ctas_on_duckdb: full pipeline through
AdapterRegistry; asserts copy_strategy="ctas" on the happy model,
copy_strategy="failed" on a missing-in-base model, and verifies
the actual table landed in the branch schema.
- copy_from_base_empty_copy_set_short_circuits: empty copy set
returns immediately without touching the adapter (matters when every
working-DAG model is changed).
Total preview unit tests: 26 (was 24).
5 tasks
hugocorreia90
added a commit
that referenced
this pull request
Apr 29, 2026
Engine 1.18.0 ships the rocky preview workflow end-to-end (#279, #280, #281, #282), the [budget].max_bytes_scanned threshold (#288), the audit-sweep closeout (#283, #285–#287, #290–#293), and the rocky-server auth + CORS gate (#291). Dagster 1.15.0 picks up the regenerated Pydantic models for the rocky preview surface and ships the P1 cluster (#289) + FR-014 follow-on (#284). VS Code 1.10.0 regenerates TypeScript bindings for rocky preview and RunCostSummary.total_bytes_scanned. See per-artifact CHANGELOG entries for the full breakdown.
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.
Summary
Lifts `rocky preview create` from planning-only output to actual copy execution. For each copy-set model, resolves the source schema from the model sidecar and issues CTAS (
CREATE OR REPLACE TABLE <branch_schema>.<model> AS SELECT * FROM <source_schema>.<model>) through the configured warehouse adapter.This is the natural follow-up to PRs #279 + #280 — the planning kernel and the diff/cost math were already shipped, this one makes the prune-and-copy substrate concrete.
What's in this PR
What's NOT in this PR (deliberate)
Test plan