Skip to content

Conversation

@jqnatividad
Copy link
Collaborator

resolves #2589

clippy::match-wildcard-for-single-variants
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds timeseries sampling functionality to the sample command, allowing users to sample time-series data by grouping records into time intervals and selecting/aggregating records within those intervals. This is particularly useful for downsampling large time-series datasets while preserving temporal patterns.

Key Changes:

  • Added --timeseries flag and related options (--ts-interval, --ts-start, --ts-adaptive, --ts-aggregate, --ts-input-tz, --ts-prefer-dmy)
  • Implemented interval-based sampling with support for hourly, daily, weekly, monthly, and yearly intervals
  • Added adaptive sampling modes to prefer records from specific time periods (business hours, weekends, business days)
  • Included aggregation functions (mean, sum, min, max, median, first, last, count) for combining multiple records within intervals

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 13 comments.

File Description
src/cmd/sample.rs Core implementation of timeseries sampling including new enum types (TSStartMode, AggregationFunction, AdaptiveMode), parsing functions for timestamps and intervals, and the main sampling logic with grouping, selection, and aggregation capabilities
tests/test_sample.rs Test suite covering basic timeseries sampling scenarios including daily/hourly intervals, different start modes (first/last), aggregation (mean), and error cases (invalid column, invalid interval)

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

@jqnatividad jqnatividad merged commit 764c07b into master Nov 28, 2025
1 check passed
@jqnatividad jqnatividad deleted the 2589-timeseries-sampling branch November 28, 2025 15:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

sample: add time-series sampling options

2 participants