-
Notifications
You must be signed in to change notification settings - Fork 80
Temporal sampling doesn't respect last instant #690
Copy link
Copy link
Closed
Description
Describe the bug
When sampling a stepwise temporal value where the last sample is right at the last instant and it changes value, this change is not reflected in the sampling.
To Reproduce
Run this example program:
#include <stdio.h>
#include <meos.h>
int main() {
/* Initialize MEOS */
meos_initialize();
Temporal *original = tbool_in("[True@2019-09-01, False@2019-09-02]");
Temporal *expected = tbool_in("[True@2019-09-01, True@2019-09-01 12:00:00, False@2019-09-02]");
Interval *interval = pg_interval_in("12 hours", -1);
TimestampTz tz = pg_timestamptz_in("2019-09-01", -1);
Temporal *sampled = temporal_tsample(original, interval, tz, STEP);
printf("Sampled Temporal: %s\n", tbool_out(sampled)); // [t@2019-09-01 00:00:00+02, t@2019-09-02 00:00:00+02]
printf("Expected Temporal: %s\n", tbool_out(expected)); // [t@2019-09-01 00:00:00+02, f@2019-09-02 00:00:00+02]
/* Finalize MEOS */
meos_finalize();
/* Return */
return EXIT_SUCCESS;
}Expected behavior
The last instant of the sampling result is false (i.e. [t@2019-09-01 00:00:00+02, f@2019-09-02 00:00:00+02]), but it is true (i.e. [t@2019-09-01 00:00:00+02, t@2019-09-02 00:00:00+02]
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels