Changeset: cd304b4b0d77 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/cd304b4b0d77
Added Files:
        geom/sql/functions/Tests/ST_MakeLine.test
Modified Files:
        geom/sql/functions/Tests/All
Branch: geo-update
Log Message:

Added test for ST_MakeLine aggregate.


diffs (62 lines):

diff --git a/geom/sql/functions/Tests/All b/geom/sql/functions/Tests/All
--- a/geom/sql/functions/Tests/All
+++ b/geom/sql/functions/Tests/All
@@ -12,6 +12,7 @@ HAVE_GEOM?dropTestWKT
 
 HAVE_GEOM?ST_MakePoint
 HAVE_GEOM?ST_Collect
+HAVE_GEOM?ST_MakeLine
 
 HAVE_GEOM?loadTestGeometries
 
diff --git a/geom/sql/functions/Tests/ST_MakeLine.test 
b/geom/sql/functions/Tests/ST_MakeLine.test
new file mode 100644
--- /dev/null
+++ b/geom/sql/functions/Tests/ST_MakeLine.test
@@ -0,0 +1,46 @@
+# column aggregation
+
+## full column aggregation
+query T rowsort
+SELECT
+    ST_MAKELINE(points)
+FROM (
+    VALUES
+        (ST_GeomFromText('POINT(0 0)')),
+        (ST_GeomFromText('POINT(10 10)')),
+        (ST_GeomFromText('POINT(20 20)')),
+        (ST_GeomFromText('POINT(5 5)'))
+) AS REL(points)
+----
+LINESTRING (0 0, 10 10, 20 20, 5 5)
+
+## grouped column aggregation
+query T rowsort
+SELECT
+    ST_MAKELINE(points)
+FROM (
+    VALUES
+        (1, ST_GeomFromText('POINT(0 0)')),
+        (2, ST_GeomFromText('POINT(10 10)')),
+        (2, ST_GeomFromText('POINT(20 20)')),
+        (1, ST_GeomFromText('POINT(5 5)')),
+        (3, ST_GeomFromText('POINT(30 30)'))
+) AS REL(id, points)
+GROUP BY id
+----
+LINESTRING (0 0, 5 5)
+LINESTRING (10 10, 20 20)
+LINESTRING (30 30)
+
+# row aggregation
+query T rowsort
+SELECT
+    ST_MAKELINE(points)
+FROM (
+    VALUES
+        (ST_GeomFromText('POINT(0 0)'), ST_GeomFromText('POINT(10 10)')),
+        (ST_GeomFromText('POINT(20 20)'), ST_GeomFromText('POINT(5 5)'))
+) AS REL(p1, p2)
+----
+LINESTRING (0 0, 10 10)
+LINESTRING (20 20, 5 5)
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to