Skip to content
Merged
Show file tree
Hide file tree
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
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,11 @@ SparkSession spark = SparkSession.builder().appName("mobilityspark").master("loc
GeneratedSpatioTemporalUDFs.registerAll(spark);
```

Temporal values, spans, span sets and sets travel as their MEOS WKB bytes, a binary column, and a
column of their hex-WKB text reads as well; geometries travel as WKT or EWKT text, and boxes,
circular buffers, network points and poses as their text form:
A value travels in the codec the MEOS catalog states for its type: temporal values, spans, span
sets, sets, boxes, circular buffers, network points and poses as their MEOS WKB bytes, a binary
column, read as well from their hex-WKB text and, for a type with a generic text reader such as a
box, from their text form; geometries travel as EWKT and are read from WKT or EWKT, and network
segments and JSON as their text form:

```sql
-- accessors under their canonical MobilityDB SQL names
Expand Down
6 changes: 6 additions & 0 deletions src/test/java/org/mobilitydb/spark/GeneratedSurfaceTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,12 @@ void values_travel_as_wkb_and_hex_wkb_stays_readable() {
assertTrue(t instanceof byte[], "a temporal travels as WKB, got " + t.getClass());
Object span = scalar("SELECT timeSpan(" + tint + ")");
assertTrue(span instanceof byte[], "a span travels as WKB, got " + span.getClass());
// A box travels as its WKB bytes too, and is read from those bytes and from its text.
String box = "'STBOX X((1,1),(2,2))'";
Object stbox = scalar("SELECT stbox_in(" + box + ")");
assertTrue(stbox instanceof byte[], "a box travels as WKB, got " + stbox.getClass());
assertEquals("STBOX X((1,1),(2,2))", scalar("SELECT stbox_out(stbox_in(" + box + "), 15)"));
assertEquals(Boolean.FALSE, scalar("SELECT hasZ(" + box + ")"));
// The bytes and the hex-WKB text of one value answer alike.
assertEquals(3, ((Number) scalar("SELECT numInstants(" + tint + ")")).intValue());
assertEquals(3, ((Number) scalar("SELECT numInstants('" + TINT_HEX + "')")).intValue());
Expand Down
Loading