Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 60 additions & 0 deletions test/sql/parity/036_tnumber_distance_span.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# name: test/sql/parity/036_tnumber_distance_span.test
# description: MobilityDB regression file 036_tnumber_distance.test.sql adapted for MobilityDuck
# group: [sql]
#
# The nearest approach distance of a number span to a temporal box or to a
# temporal number of its base type, in either order.

require mobilityduck

query I
SELECT intspan '[-5,-4)' |=| tbox 'TBOXINT XT([0,6),[2001-01-01,2001-01-03])';
----
5.0

query I
SELECT tbox 'TBOXINT XT([0,6),[2001-01-01,2001-01-03])' |=| intspan '[10,12)';
----
5.0

query I
SELECT floatspan '[-5,-4]' |=| tbox 'TBOXFLOAT X([0,5])';
----
4.0

query I
SELECT tint '[0@2001-01-01, 5@2001-01-03]' |=| intspan '[-5,-4)';
----
5.0

query I
SELECT intspan '[10,12)' |=| tint '[0@2001-01-01, 5@2001-01-03]';
----
5.0

query I
SELECT bigintspan '[10,12)' |=| tbigint '[0@2001-01-01, 5@2001-01-03]';
----
5.0

query I
SELECT tfloat '[0@2001-01-01, 5@2001-01-03]' |=| floatspan '[-5,-4]';
----
4.0

query I
SELECT nearestApproachDistance(intspan '[1,3)', tbox 'TBOXINT X([2,6))');
----
0.0

# MobilityDB refuses it in its PostgreSQL wrapper; DuckDB reaches
# nad_floatspan_tbox, whose MEOS validation refuses the integer box
statement error
SELECT floatspan '[1,2]' |=| tbox 'TBOXINT X([0,6))';
----
The span must be of type floatspan

statement error
SELECT intspan '[1,2)' |=| tbox 'TBOX T([2001-01-01,2001-01-02])';
----
The tbox must have X dimension
Loading