Skip to content

Read the distance of times as the interval MEOS answers - #138

Merged
estebanzimanyi merged 1 commit into
MobilityDB:mainfrom
estebanzimanyi:fix/time-distances-are-intervals
Oct 3, 2026
Merged

estebanzimanyi merged 1 commit into
MobilityDB:mainfrom
estebanzimanyi:fix/time-distances-are-intervals

Conversation

@estebanzimanyi

Copy link
Copy Markdown
Member

tstzspan.distance answers the seconds, with their fraction, of the interval
distance_tstzspan_tstzspan and distance_tstzspanset_tstzspan return, and tstzset.distance
the Duration of the interval distance_set_timestamptz and distance_tstzset_tstzset return.
ConversionUtils.interval_to_timedelta reads an interval's fields where the catalog lays them
out, the microseconds at byte 0, the days at byte 8 and the months at byte 12, and refuses an
interval holding months, which has no fixed duration. ConversionUtilsIntervalTest reads one
day, a time below a day, a fraction of a second and days with a time, and refuses one month;
TsTzSetTest asserts the 120 days between its sets.

Witness: MobilityDB 43cfd3f936 (#2942) returns the seven distances between times as an
Interval *, where they returned a double, and jmeos-core no longer compiles against it:
tstzspan.java and tstzset.java pass the Pointer where a double is read. interval_to_timedelta
parsed interval_out with a pattern of "N days HH:MM:SS", so "1 day", "03:04:05" and
"00:00:01.25" raised or lost their fraction.

Why: JMEOS builds against MobilityDB master, so every JMEOS build fails until it reads the
interval MEOS answers.

Measured: against MobilityDB 43cfd3f936 and the catalog of MEOS-API 1192ae4f01, the clean
build and suite pass, 1,800 and 106 tests, with no warning.

tstzspan.distance answers the seconds, with their fraction, of the interval
distance_tstzspan_tstzspan and distance_tstzspanset_tstzspan return, and tstzset.distance
the Duration of the interval distance_set_timestamptz and distance_tstzset_tstzset return.
ConversionUtils.interval_to_timedelta reads an interval's fields where the catalog lays them
out, the microseconds at byte 0, the days at byte 8 and the months at byte 12, and refuses an
interval holding months, which has no fixed duration. ConversionUtilsIntervalTest reads one
day, a time below a day, a fraction of a second and days with a time, and refuses one month;
TsTzSetTest asserts the 120 days between its sets.

Witness: MobilityDB 43cfd3f936 (#2942) returns the seven distances between times as an
Interval *, where they returned a double, and jmeos-core no longer compiles against it:
tstzspan.java and tstzset.java pass the Pointer where a double is read. interval_to_timedelta
parsed interval_out with a pattern of "N days HH:MM:SS", so "1 day", "03:04:05" and
"00:00:01.25" raised or lost their fraction.

Why: JMEOS builds against MobilityDB master, so every JMEOS build fails until it reads the
interval MEOS answers.

Measured: against MobilityDB 43cfd3f936 and the catalog of MEOS-API 1192ae4f01, the clean
build and suite pass, 1,800 and 106 tests, with no warning.
@estebanzimanyi
estebanzimanyi merged commit 8ba706e into MobilityDB:main Oct 3, 2026
2 checks passed
@estebanzimanyi
estebanzimanyi deleted the fix/time-distances-are-intervals branch October 3, 2026 13:50
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.

1 participant