Repository navigation
feat(retrieval): branch delta, survivors, comparison, nearest and after - #117
Merged
Merged
Conversation
Five read-only statements for global admins answer what a branch changed since its fork (BRANCH DELTA), what in its head is untouched since then (BRANCH SURVIVORS), how two branches diverged from their common ancestor (COMPARE BRANCH), which branches are closest to one (NEAREST BRANCH) and which later commits touched the atoms of a given commit (BRANCH AFTER). An entry is an incidence, an atom or one property. A side's net change comes from the ancestor snapshot when it is retained and otherwise from the change feed folded over the branch's lineage; both give the same rows. NEAREST diffs heads directly and prunes candidates with a lower bound from root counts. Commits that changed nothing have no feed event, and BRANCH AFTER on one returns no rows. No issue tracks this work.
Moving a member of an ordered edge changes only its position label, which is not part of an entry; the snapshot route reported it as a change while the feed route did not, and now neither does. Ancestors and lineages are resolved over every branch record, so a branch whose parent was merged or dropped no longer fails or loses its parent's history. Every member change, expanded deletion, feed change and scanned entry now counts against the budget. Comparing a branch with itself returns nothing, a SINCE generation in the future and BRANCH AFTER on another branch's commit are refused, WINDOW must not be negative, AMONG ignores repeated names, and NEAREST takes its bounds and distances from the same snapshots. No issue tracks this work.
# Conflicts: # database/src/main/java/io/hstore/db/query/Ast.java # database/src/main/java/io/hstore/db/query/Executor.java # database/src/main/java/io/hstore/db/query/Parser.java # server/src/main/java/io/hstore/server/StatementLogger.java
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.
Stacked on #115: it reuses the change-feed fold and lineage from #115. Merge #115 first, then retarget this to
main.This adds five read-only statements about branches. Like
DIFFandHISTORY, they are for global admins only.BRANCH DELTA b [SINCE GENERATION g]bchanged since its fork (or sinceg): one row per incidence, atom or property, with values before and afterBRANCH SURVIVORS bb's head untouched since the forkCOMPARE BRANCH b AND cONLY_LEFT,ONLY_RIGHT,BOTH_SAMEorBOTH_DIFFERENTNEAREST BRANCH TO b [AMONG (…)] TOP kBRANCH AFTER b GENERATION g [WINDOW w]bthat touched an atom commitgtouched; this shows what came after, not what was causedEvery statement except
AFTERacceptsSCOPE INCIDENCES | TYPE T | AROUND @atom. The syntax is open for renaming before merge.How it is answered
NEARESTdiffs the heads directly and skips candidates whose lower bound (difference in incidence or type counts) cannot beat the k-th best.Testing
Independent review. It found three important issues, fixed here with tests that failed first:
TRANSITIONSis fixed on feat(retrieval): validity transitions, TRANSITIONS and the retrieval indexes (format 9) #115.It also found several smaller issues, fixed and tested here: comparing a branch with itself, a
SINCEin the future,AFTERon another branch's commit, a negativeWINDOW, repeatedAMONGnames, and bounds taken from a different snapshot than distances.Not done here
updateAtomcan cause one today.AT GENERATIONpin.