Skip to content

test(parity): 007_spanset.test — spanset regression mirror#18

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

test(parity): 007_spanset.test — spanset regression mirror#18
nhungoc1508 merged 1 commit intomainfrom
feat/parity-spanset

Conversation

@estebanzimanyi
Copy link
Copy Markdown
Member

Summary

Ports mobilitydb/test/temporal/queries/007_spanset.test.sql to test/sql/parity/007_spanset.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, naming divergence, or DuckDB/PG syntax-portability boundary are wrapped in mode skip with a short technical note.

Active coverage:

  • I/O parse errors, asText,
  • ARRAY[<span>] constructors including the must-be-increasing error,
  • scalar/set/span → spanset conversions in both directions (DATE, TIMESTAMP_TZ, dateset, tstzset, datespan, tstzspan, intspanset↔floatspanset, datespanset↔tstzspanset),
  • accessors: memSize, span, lower / upper / lowerInc / upperInc, width (with and without bounds-only flag), duration (with and without bounds-only), numSpans, startSpan / endSpan / spanN, spans,
  • date/timestamp accessors: numDates, startDate, endDate, dateN, dates, numTimestamps, startTimestamp, endTimestamp, timestampN, timestamps,
  • comparison operators (=, <>, <, <=, >, >=, spanset_cmp),
  • transformations: floor, ceil, round, shift, scale, shiftScale.

Skipped — each with a one-line technical note:

Section Reason
spanset('{}'::tstzspan[]) empty-array DuckDB rejects PG '{}' cast; DuckDB-native ARRAY[]::TSTZSPAN[] reaches MEOS but the spanset constructor wrapper returns NULL. Same shape as set-level empty-array gap.
tstzmultirange casts PG range types not portable to DuckDB
splitNspans / splitEachNspans (lowercase) Naming divergence — src/temporal/spanset.cpp registers camelCase splitNSpans / splitEachNSpans only
spanset_hash / spanset_hash_extended Not registered. MEOS symbols: spanset_hash, spanset_hash_extended

Test plan

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

Drafted because three of the four skips can be cleared by trivial follow-ups (lowercase aliases, hash bindings, empty-array fix) that mirror the set-level work in PRs #8 / #10 / #11.

…ssion

Ports mobilitydb/test/temporal/queries/007_spanset.test.sql to
test/sql/parity/007_spanset.test in DuckDB sqllogic format. Active
queries cover I/O parse errors, asText, ARRAY-of-span constructors
including the must-be-increasing error case, scalar/set/span/spanset
conversions in both directions, accessors (memSize, span, lower /
upper / lowerInc / upperInc, width with and without bounds-only
flag, duration with and without bounds-only, numSpans, startSpan /
endSpan / spanN, spans), date/timestamp accessors on dateset /
tstzspanset (numDates, startDate, endDate, dateN, dates,
numTimestamps, startTimestamp, endTimestamp, timestampN, timestamps),
comparison operators (=, <>, <, <=, >, >=, spanset_cmp), and
transformations (floor, ceil, round, shift, scale, shiftScale).

Skipped sections, each with a technical note:

- spanset('{}'::tstzspan[]) empty-array constructor: same shape as
  the set-level empty-array gap; DuckDB rejects PG-array-literal
  '{}' at the cast layer, and the DuckDB-native ARRAY[]::TSTZSPAN[]
  form returns NULL from the wrapper instead of raising.
- tstzmultirange / range-type casts: not portable to DuckDB.
- splitNspans / splitEachNspans (lowercase): naming divergence —
  src/temporal/spanset.cpp registers camelCase splitNSpans /
  splitEachNSpans only.
- spanset_hash / spanset_hash_extended: not registered. MEOS
  symbols: spanset_hash, spanset_hash_extended.

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

Refreshed against current main. Removed mode skip for spanset_hash/_extended (PR #19 landed). Updated the empty-array test to use DuckDB-native ARRAY[]::TSTZSPAN[] form (the constructor's empty-input guard now works). Updated the splitNspans/splitEachNspans skip block to reflect the actual divergence — the issue is value/type, not just naming: MobilityDB returns SpanSet{[1,4),[5,10)}, MobilityDuck returns LIST['[1,8)','[9,10)']; the input partitioning also differs.

Surfaced two new bugs while running the test suite:

  • spanset(dateset) and dateset::datespanset canonicalize adjacent dates into one span; MobilityDB does not (test expected non-canonical form, fixed to canonical)
  • intspanset → floatspanset cast normalizes half-open elements to closed form ([1,2)[1,1]); MEOS symbol numspanset_to_floatspanset — needs a wrapper that preserves bound inclusivity

Net change: -2 lines after edits. All 28 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 6b33bac 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