Skip to content

test(parity): 005_span_ops.test — span operators regression mirror#17

Merged
nhungoc1508 merged 1 commit intomainfrom
feat/parity-span-ops
May 4, 2026
Merged

test(parity): 005_span_ops.test — span operators regression mirror#17
nhungoc1508 merged 1 commit intomainfrom
feat/parity-span-ops

Conversation

@estebanzimanyi
Copy link
Copy Markdown
Member

Summary

Ports mobilitydb/test/temporal/queries/005_span_ops.test.sql to test/sql/parity/005_span_ops.test in DuckDB sqllogic format. Same shape as the earlier parity files: active queries reflect MobilityDuck's display format; queries that hit a missing binding or known wrong-return-type registration are wrapped in mode skip with a short technical note.

Active coverage:

  • containment (@>, <@),
  • overlap (&&),
  • span-span adjacency (-|-),
  • equality (=),
  • span-span union (+),
  • span-span intersection (*) including the empty-overlap NULL case,
  • span-span difference (-, returns SpanSet for both empty / single / multi-component results),
  • span-vs-value and span-vs-span distance (<->).

Skipped — each with a one-line technical note:

Section Reason
Position predicates between span and value (`- -, <<, >>, &<, &>`)
Disjoint-union floatspan '[1, 1]' + floatspan '[3, 4]' Returns SpanSet in MEOS, but + is registered as SpanType
Value-value distance 1.0 <-> 1.0 Not registered. MEOS symbol: distance_value_value

Test plan

  • make release then TZ=UTC ./build/release/test/unittest "<proj>/test/*" — full suite passes (752 assertions across 14 test cases).

Drafted because the position-predicate skip in this file overlaps with the in-flight position-predicates fix PR; mark ready / merge once that lands.

…ression

Ports mobilitydb/test/temporal/queries/005_span_ops.test.sql to
test/sql/parity/005_span_ops.test in DuckDB sqllogic format. Active
queries cover containment (@>, <@), overlap (&&), span-span adjacency
(-|-), equality (=), span-span union (+), span-span intersection (*),
span-span difference (-, returns SpanSet), and span-vs-value /
span-vs-span distance (<->).

Skipped sections, each with a technical note:

- Position predicates between span and value (-|-, <<, >>, &<, &>):
  registered in src/temporal/span.cpp with return type SpanType
  instead of BOOLEAN; the impls already return bool from MEOS.
- Disjoint-union case `floatspan '[1, 1]' + floatspan '[3, 4]'`:
  returns a SpanSet in MEOS, but `+` is registered as returning
  SpanType.
- Value-value distance `1.0 <-> 1.0`: not registered (MEOS symbol:
  distance_value_value).

Full suite passes (752 assertions, 14 test cases).
@estebanzimanyi
Copy link
Copy Markdown
Member Author

Refreshed against current main: removed mode skip blocks for now-landed bindings — -|- value/span and span/value, <</>>/&</&> value/span (PR #14 fix), and value-value <-> distance. Fixed one wrong expected value (1.0 &> floatspan '[1, 2]' is true, not false — overright_value_span returns true when v >= lower bound).

Surfaced a new finding: + for span × span is broken regardless of whether inputs overlap or are disjoint — returns canonical empty (t, t) instead of the union. Expanded the existing skip block to cover all three union cases. The MEOS symbol is union_span_span (returns SpanSet for disjoint, Span for connected) — needs a polymorphic wrapper that returns SpanSet generically.

Net change: -21 lines after the wider skip. All 23 query assertions pass locally with TZ=UTC.

estebanzimanyi added a commit that referenced this pull request Apr 28, 2026
Single-file inventory of MobilityDB's mobilitydb/test/geo/queries/
surface. Rather than one parity file per upstream regression file,
this lists what each file covers, what's bound in MobilityDuck
today, and what's missing.

Bound surface (per direct audit of src/geo/tgeompoint.cpp):
- tgeompoint / tgeometry I/O for instant / discrete / continuous /
  sequence-set
- asText / asEWKT / memSize / interp / round / transform
- Constructors (TGEOMPOINT, tgeompointInst, tgeompointSeq,
  tgeompointSeqSet)
- Spatial accessors: getX/Y/Z, length, cumulativeLength, speed,
  direction, azimuth, angularDifference, trajectory
- Topological predicates: e/a/t variants of Contains, Disjoint,
  Dwithin, Intersects, Touches
- Set ops: makeSimple, isSimple, stops
- Restrictions: atGeometry, atStbox, atValues, atTime and the
  matching minus*
- Modification: appendInstant, appendSequence, insert, update,
  deleteTime, merge
- Comparison: temporal_eq / temporal_ne / etc.
- twCentroid, shortestLine, distance_gs, collect_gs

Unbound surface (per upstream regression file, with cross-references
to the temporal-side parity-batch PRs that cover the same gap):
- 051_stbox: stbox tests (whole file currently skipped in
  test/sql/stbox.test for DuckDB 1.4 signature issues).
- 052_tgeo / 052_tpoint: mostly bound — per-type ports would mirror
  PRs #13 / #17 / #18 patterns.
- 053_*_inout: asMFJSON / asWKB / asHexWKB / asGeoJSON — verify
  which are bound.
- 054_*_compops: same parser blocker as PR #24's 030 (?= / #=).
- 056_*_spatialfuncs: bulk bound; setSRID-on-temporal and
  reference-system accessors missing.
- 058_*_tile: same gap as PR #23's 025 but for tspatial.
- 060_*_topops: same pattern as PR #25's 032_temporal_topops.
- 062_*_posops: same pattern as PR #24's 034_temporal_posops plus
  spatial-direction operators.
- 064_*_distance: <-> for tgeo / tpoint; partially bound
  (shortestLine, distance_gs).
- 066_tpoint_similarity: specialisation of PR #23's 038.
- 068_*_aggfuncs: same architectural blocker as PR #21 (no
  AggregateFunction infra).

Suite: 747 assertions, 23 test cases.
@estebanzimanyi estebanzimanyi marked this pull request as ready for review May 1, 2026 19:13
@nhungoc1508 nhungoc1508 merged commit 1c153a1 into main May 4, 2026
17 checks passed
nhungoc1508 pushed a commit that referenced this pull request May 4, 2026
Single-file inventory of MobilityDB's mobilitydb/test/geo/queries/
surface. Rather than one parity file per upstream regression file,
this lists what each file covers, what's bound in MobilityDuck
today, and what's missing.

Bound surface (per direct audit of src/geo/tgeompoint.cpp):
- tgeompoint / tgeometry I/O for instant / discrete / continuous /
  sequence-set
- asText / asEWKT / memSize / interp / round / transform
- Constructors (TGEOMPOINT, tgeompointInst, tgeompointSeq,
  tgeompointSeqSet)
- Spatial accessors: getX/Y/Z, length, cumulativeLength, speed,
  direction, azimuth, angularDifference, trajectory
- Topological predicates: e/a/t variants of Contains, Disjoint,
  Dwithin, Intersects, Touches
- Set ops: makeSimple, isSimple, stops
- Restrictions: atGeometry, atStbox, atValues, atTime and the
  matching minus*
- Modification: appendInstant, appendSequence, insert, update,
  deleteTime, merge
- Comparison: temporal_eq / temporal_ne / etc.
- twCentroid, shortestLine, distance_gs, collect_gs

Unbound surface (per upstream regression file, with cross-references
to the temporal-side parity-batch PRs that cover the same gap):
- 051_stbox: stbox tests (whole file currently skipped in
  test/sql/stbox.test for DuckDB 1.4 signature issues).
- 052_tgeo / 052_tpoint: mostly bound — per-type ports would mirror
  PRs #13 / #17 / #18 patterns.
- 053_*_inout: asMFJSON / asWKB / asHexWKB / asGeoJSON — verify
  which are bound.
- 054_*_compops: same parser blocker as PR #24's 030 (?= / #=).
- 056_*_spatialfuncs: bulk bound; setSRID-on-temporal and
  reference-system accessors missing.
- 058_*_tile: same gap as PR #23's 025 but for tspatial.
- 060_*_topops: same pattern as PR #25's 032_temporal_topops.
- 062_*_posops: same pattern as PR #24's 034_temporal_posops plus
  spatial-direction operators.
- 064_*_distance: <-> for tgeo / tpoint; partially bound
  (shortestLine, distance_gs).
- 066_tpoint_similarity: specialisation of PR #23's 038.
- 068_*_aggfuncs: same architectural blocker as PR #21 (no
  AggregateFunction infra).

Suite: 747 assertions, 23 test cases.
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.

2 participants