feat: apply data masks on the full_refresh_build=prebuilt path - #804
Open
Benjamin-Knight wants to merge 1 commit into
Open
feat: apply data masks on the full_refresh_build=prebuilt path#804Benjamin-Knight wants to merge 1 commit into
Benjamin-Knight wants to merge 1 commit into
Conversation
The prebuilt rebuild path drops and recreates the table but never called apply_masks, so a model configured with both full_refresh_build=prebuilt and masks / masked_with silently lost its masks on every --full-refresh. (Independent feature branches: masking predated prebuilt and never wired that path.) Apply masks after the load but before create_indexes in the use_prebuilt branch, mirroring the standard build path. Ordering matters on prebuilt: the clustered design (CCI or clustered rowstore index) is built inside create_table_as_prebuilt before masks can be applied, while nonclustered indexes are built afterward by create_indexes. Applying masks before create_indexes lets a mask on a nonclustered key column land before that index exists (mask-then-index). A CCI exposes no key columns so masks apply freely; a mask on a clustered rowstore key column can't be honoured on this path and apply_masks raises its descriptive index-key error. Add a functional test covering all three cases (CCI maskable, nonclustered key masked before its index, clustered rowstore key errors). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
Resolve #805
The prebuilt rebuild path drops and recreates the table but never called apply_masks, so a model configured with both full_refresh_build=prebuilt and masks / masked_with silently lost its masks on every --full-refresh. (Independent feature branches: masking predated prebuilt and never wired that path.)
Apply masks after the load but before create_indexes in the use_prebuilt branch, mirroring the standard build path. Ordering matters on prebuilt: the clustered design (CCI or clustered rowstore index) is built inside create_table_as_prebuilt before masks can be applied, while nonclustered indexes are built afterward by create_indexes. Applying masks before create_indexes lets a mask on a nonclustered key column land before that index exists (mask-then-index). A CCI exposes no key columns so masks apply freely; a mask on a clustered rowstore key column can't be honoured on this path and apply_masks raises its descriptive index-key error.
Add a functional test covering all three cases (CCI maskable, nonclustered key masked before its index, clustered rowstore key errors).