Fix: preserve double timestamps for PointValueAggregator and unify event start_ts/end_ts type - #65
Merged
Merged
Conversation
- Updated PointValueAggregator to remove unnecessary casting of point timestamps to long, preserving original types for start_ts and end_ts. - Modified ContainerEvent and PointsInTimeEvent classes to cast timestamps to double instead of long, ensuring compatibility with shared event types. - Enhanced comments to clarify the purpose of timestamp handling in relation to event instance fact tables.
…ports - Introduced a new test to validate that a mixture of PointsInTimeEvent, ContainerEvent, and BasicEvent can be processed across incremental runs while maintaining a consistent output structure. - Ensured that all event types agree on the data type for shared timestamp columns (start_ts and end_ts) as double, preventing type conflicts during persistence. - Enhanced assertions to verify the presence of fact data for all event types after incremental updates, ensuring data integrity across runs.
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.
Summary
When a report mixed a PointValueAggregator (PVA) and a StatsAggregator and the channel timestamps were double, the PVA cast point timestamps to long while the StatsAggregator passed double through. This truncated fractional timestamps and, because every event type writes to the shared event_instance_fact table, produced inconsistent column types. In incremental mode this surfaced as a hard failure — DELTA_MERGE_INCOMPATIBLE_DATATYPE: LongType and DoubleType — when a report seeded with long-emitting events (PointsInTimeEvent/ContainerEvent) later had a double-emitting event (BasicEvent) added. (A single full run hid the bug: per-type DataFrames are unioned before the first write, silently widening long→double.)
Changes
Result: every event type now emits double start_ts/end_ts, so event_instance_fact has a stable double schema from the first write. BasicEvent/SequenceOfEvents already emitted double, so they were unchanged.
Test Plan
Checklist