Repository navigation
Conversation
startingVersionFromDLTSetup set the CDF startingVersion to the latest 'DLT SETUP' in the source table's history. A normal update also writes 'DLT SETUP' whenever the table definition changes, so the latest one can sit after data the table still holds. A reader with no checkpoint (e.g. a downstream table that is fully refreshed on its own) then silently skips that data. The starting version is now the first 'DLT SETUP' at or after the latest 'DLT REFRESH' (the commit a full refresh writes), or the earliest 'DLT SETUP' if the table was never fully refreshed. Refs #176
This branch has not been deployed
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.
startingVersionFromDLTSetupset the CDFstartingVersionto the latestDLT SETUPin the source table's history. A normal update also writesDLT SETUPwhenever the table definition changes, such as a table property or schema change. So the latest one can sit after data the table still holds. A reader with no checkpoint then silently skips that data, with no error. For example, this happens to a downstream table that is fully refreshed on its own, or one whose first run after a reset is interrupted.Changes:
SourceDeltanow starts at the firstDLT SETUPat or after the latestDLT REFRESH(the commit a full refresh writes). If the table was never fully refreshed, it uses the earliestDLT SETUP. The logic is in a small helper,resolve_starting_version_from_history().startingVersionFromDLTSetupdocs now describe the rule. They also note that tables reading the source's CDF must be fully refreshed with it, as the Databricks full refresh docs require.Tested:
starting_version_from_dlt_setupinto a downstream table. The steps were first run, full refresh, a table property change, then a full refresh of only the downstream table. Onmainthe downstream table ends up with 0 rows and no error. With this change it has all 4 rows.historical_snapshot_files_flowsample (which uses this option) gives the same output as onmain.DLT REFRESH,SET TBLPROPERTIES,DLT SETUP, then data.DLT SETUPwith no data.DLT REFRESHcommit holds adeleterow for every previous row. Starting at theDLT SETUPafter it means those deletes are never read.This covers the main problem in #176. The issue's "second, related problem" did not reproduce in my plain SDP test: during a full refresh the view already saw the refresh's own commits. I'm still testing it with the issue's full cdc-stream-from-snapshot pattern, so this PR doesn't close the issue.
Refs #176