Changeset: 0cd94e8b7d46 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/0cd94e8b7d46
Added Files:
        sql/test/analytics/Tests/topn.test
Modified Files:
        sql/test/analytics/Tests/All
Branch: ordered-set-aggregates
Log Message:

add test for grouped topn


diffs (30 lines):

diff --git a/sql/test/analytics/Tests/All b/sql/test/analytics/Tests/All
--- a/sql/test/analytics/Tests/All
+++ b/sql/test/analytics/Tests/All
@@ -30,3 +30,4 @@ analytics19
 
 # Other tests
 analytics20
+topn
diff --git a/sql/test/analytics/Tests/topn.test 
b/sql/test/analytics/Tests/topn.test
new file mode 100644
--- /dev/null
+++ b/sql/test/analytics/Tests/topn.test
@@ -0,0 +1,17 @@
+statement ok
+create table t as
+select rand() as a1, value % 100 as a2, 1e0 / (abs(rand()) + 1) as prob
+from sys.generate_series(0,10000)
+
+query I nosort
+SELECT count(*)
+FROM (
+ SELECT a1, a2, prob
+  FROM (
+   SELECT a1, a2, row_number() OVER(PARTITION BY a2 ORDER BY prob DESC) AS a3, 
prob
+   FROM t
+  ) AS t__x0
+ WHERE a3 <= 3
+) as t__x1;
+----
+300
_______________________________________________
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org

Reply via email to