Fix contract storage backfill on network-scoped catalogs - #99
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates the serving cold backfill’s contract storage “current” projection SQL to work with network-scoped DuckLake catalogs where the *_current tables do not have a network column (as in older catalog layouts), and adds a regression test to ensure the projection rebuild succeeds in that scenario.
Changes:
- Removed the
WHERE network = ...predicate from thettl_currentCTE inselectContractStorageCurrentso the query no longer requires anetworkcolumn. - Added a new unit test that provisions
silver.contract_data_current/silver.ttl_currentwithout anetworkcolumn and validatessv_contract_storage_currentrebuild output.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| obsrvr-lake/serving-cold-backfill/go/main.go | Adjusts the sv_contract_storage_current source SQL to not require a network column in network-scoped catalogs. |
| obsrvr-lake/serving-cold-backfill/go/main_test.go | Adds a regression test ensuring contract storage projection rebuild works when current tables omit the network column. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+127
to
+133
| var projection CurrentProjection | ||
| for _, candidate := range currentProjections() { | ||
| if candidate.Name == "sv_contract_storage_current" { | ||
| projection = candidate | ||
| break | ||
| } | ||
| } |
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.
This pull request updates the handling of network-scoped current tables to support catalogs that do not include a
networkcolumn, improving compatibility with older data layouts. It also adds a new test to verify this behavior.Support for network-scoped current tables without a network column:
networkin theselectContractStorageCurrentquery, allowing the function to work with tables that do not have anetworkcolumn. [1] [2]selectContractStorageCurrentto clarify that the query must not require anetworkcolumn due to older catalogs.Testing improvements:
TestContractStorageProjectionSupportsNetworkScopedCurrentTablesWithoutNetworkColumnto ensure that the contract storage projection works correctly when thenetworkcolumn is missing from current tables.