fix: sqlite reader restores master-table order instead of type grouping - #66
Merged
Conversation
Events and objects were assembled one per-type table at a time (alphabetical), so log.events came back grouped by type. ocel-mine breaks timestamp ties by log index, which made tie resolution format-dependent: the same log read from .sqlite put 'label' before 'open issue' in every same-second trace (564/974 issues in the sharkdp/fd measurement log), while the JSON reader preserved the written order. The reader now reorders events/objects by the master event/object table's rowid order — exactly what the writer wrote, matching JSON semantics. Ids missing from the master table sort last, keeping their relative order (stable sort). Closes #65
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.
Found by reading real-data numbers, not code: the top issue variant of the sharkdp/fd measurement log read
label > open issue > ...— a label before the issue exists.Cause: the reader assembles events one per-type table at a time (alphabetical via
event_map_type), solog.eventscomes back grouped by type. ocel-mine breaks timestamp ties by log index; 564/974 fd issues carry a label stamped the same second as their open event, and every one of those ties resolved to label-first from .sqlite while the JSON reader (which preserves file order) resolves them open-first. Same log, different variants per format.Fix: after assembly, reorder events/objects by the master
event/objecttable rowid order — exactly the order the writer wrote (write_base_rowsinserts inocel.eventsorder), matching JSON semantics. Ids missing from the master tables sort last with relative order preserved (stable sort).read_restores_write_order_not_type_grouping— log order deliberately disagrees with alphabetical type order for both events and objectsocel convert fd.sqlite → jsonnow showsopen issuebefore its same-secondlabel(issue #574 spot-checked)Closes #65