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
15 changes: 15 additions & 0 deletions src/test/java/org/mobilitydb/spark/GeneratedSqlSurfaceTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,21 @@ void textConstructorsAndOutput() {
assertEquals(true, scalar("SELECT spanOverlaps(floatspan_in('[1, 3]'), floatspan_in('[2, 4]'))"));
}

@Test
void anArgumentLeftToItsNullDefaultIsWhatTheWrapperPasses() {
// tintSeqSetGaps without maxdist splits on time alone (the wrapper's -1.0), and
// without maxt either it splits on nothing (the wrapper's NULL)
String instants = "array(tintFromText('1@2020-01-01'), tintFromText('2@2020-01-02'), "
+ "tintFromText('3@2020-01-05'))";
assertEquals(2, scalar("SELECT numSequences(tintSeqSetGaps(" + instants
+ ", INTERVAL '1' DAY))"));
assertEquals(1, scalar("SELECT numSequences(tintSeqSetGaps(" + instants + "))"));
// tfloatSeq without an interpolation keeps the value's own (the wrapper's
// INTERP_NONE) and makes an instant a sequence
assertEquals("Sequence", scalar("SELECT tempSubtype(tfloatSeq("
+ "tfloatFromText('1@2020-01-01')))"));
}

@Test
void anOmittedInterpolationIsTheOneOfTheType() {
// appendInstant and the sequence set constructors without an interpolation take the
Expand Down
Loading