REPOSITORY CODING · EASY
Millisecond observations disappear from research windows
The event-time transformation treats millisecond values as seconds. Restore normalization before period selection and epoch-window assignment.
Data EngineerResearch observation window exports
Work through a real codebase.
Choose an environment, investigate the existing implementation and use the tests to check your change. Sign in to open a workspace; execution and Ono usage follow your plan’s allowances.
Task requirements and environments
PySpark · 35 minute session
- Events contain tenant, id, study, subject, revision, observed time, event timestamp, timestamp unit (s or ms), integer value and deleted. observed, start, end and asOf are epoch seconds. Normalize ms timestamps by flooring division by 1000.
- Only revisions observed at or before asOf are visible. Select the greatest revision per (tenant,id), retaining deletions. Exact duplicate revisions are allowed; conflicting same revisions are rejected.
- After resolving history, select the requested tenant, remove deleted events and retain event seconds in the half-open range [start,end). A correction outside the interval removes its former in-range version.
- Aggregate actual Spark DataFrames by study and epoch-aligned windows of windowSeconds. Return count, sum of value, and distinct subjects in each group; sort by study then window start. Count events rather than unique subjects.
- Return windows, total event count, total value, and a deterministic LF-terminated CSV with header study,start,end,count,total,subjects. Window end may exceed the report interval because buckets are epoch-aligned. Empty results include the header.
- The bounded HTTP training service reuses one local Spark session. It performs no external writes. Source modules contain real Spark transformations; edit them, restart with bash start.sh and run visible tests. These batch checks take longer than ordinary language checks.