You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@madlib.apache.org by ri...@apache.org on 2018/06/15 15:29:00 UTC

[2/2] madlib git commit: KNN: Make install-check asserts deterministic

KNN: Make install-check asserts deterministic

Knn install-check had a couple of unordered array_agg asserts which were not
deterministic. This commit ensures the order is deterministic.

Closes #279


Project: http://git-wip-us.apache.org/repos/asf/madlib/repo
Commit: http://git-wip-us.apache.org/repos/asf/madlib/commit/b88f6046
Tree: http://git-wip-us.apache.org/repos/asf/madlib/tree/b88f6046
Diff: http://git-wip-us.apache.org/repos/asf/madlib/diff/b88f6046

Branch: refs/heads/master
Commit: b88f60464645c5df443b7f371dcc8075e2a0bccb
Parents: 89bcdb7
Author: Nikhil Kak <nk...@pivotal.io>
Authored: Thu Jun 14 10:20:55 2018 -0700
Committer: Rahul Iyer <ri...@apache.org>
Committed: Fri Jun 15 08:24:43 2018 -0700

----------------------------------------------------------------------
 src/ports/postgres/modules/knn/test/knn.sql_in | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/madlib/blob/b88f6046/src/ports/postgres/modules/knn/test/knn.sql_in
----------------------------------------------------------------------
diff --git a/src/ports/postgres/modules/knn/test/knn.sql_in b/src/ports/postgres/modules/knn/test/knn.sql_in
index 6a39c89..20348af 100644
--- a/src/ports/postgres/modules/knn/test/knn.sql_in
+++ b/src/ports/postgres/modules/knn/test/knn.sql_in
@@ -77,7 +77,7 @@ select assert(array_agg(prediction order by id)='{1,1,0,1,0,0}', 'Wrong output i
 
 drop table if exists madlib_knn_result_classification;
 select knn('knn_train_data','data','id','label','knn_test_data','data','id','madlib_knn_result_classification',3);
-select assert(array_agg(x)= '{1,2,3}','Wrong output in classification with k=3') from (select unnest(k_nearest_neighbours) as x from madlib_knn_result_classification where id = 1 order by x asc) y;
+select assert(array_agg(x order by id)= '{1,2,3}','Wrong output in classification with k=3') from (select unnest(k_nearest_neighbours) as x, id from madlib_knn_result_classification where id = 1 order by x asc) y;
 
 drop table if exists madlib_knn_result_regression;
 select knn('knn_train_data_reg','data','id','label','knn_test_data','data','id','madlib_knn_result_regression',4,False,'MADLIB_SCHEMA.squared_dist_norm2',False);
@@ -85,7 +85,7 @@ select assert(array_agg(prediction order by id)='{1,1,0.5,1,0.25,0.25}', 'Wrong
 
 drop table if exists madlib_knn_result_regression;
 select knn('knn_train_data_reg','data','id','label','knn_test_data','data','id','madlib_knn_result_regression',3,True);
-select assert(array_agg(x)= '{1,2,3}' , 'Wrong output in regression with k=3') from (select unnest(k_nearest_neighbours) as x from madlib_knn_result_regression where id = 1 order by x asc) y;
+select assert(array_agg(x order by id)= '{1,2,3}' , 'Wrong output in regression with k=3') from (select unnest(k_nearest_neighbours) as x, id from madlib_knn_result_regression where id = 1 order by x asc) y;
 
 drop table if exists madlib_knn_result_classification;
 select knn('knn_train_data','data','id','label','knn_test_data','data','id','madlib_knn_result_classification',3,False,NULL,False);