From ccfe82b77ce6a375f2faba719386bcd26bd567ff Mon Sep 17 00:00:00 2001 From: Daniel Gustafsson Date: Thu, 24 Jan 2019 14:00:30 +0100 Subject: [PATCH] Stabilize gp_sparse_vector test Remove redundant test on array_agg which didn't have a stable output, and remove an ORDER BY to let atmsort deal with differences instead. Reviewed-by: Heikki Linnakangas --- gpcontrib/gp_sparse_vector/expected/gp_svec.out | 8 +------- gpcontrib/gp_sparse_vector/sql/gp_svec.sql | 3 +-- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/gpcontrib/gp_sparse_vector/expected/gp_svec.out b/gpcontrib/gp_sparse_vector/expected/gp_svec.out index dd945096f0..2ceb8c588c 100644 --- a/gpcontrib/gp_sparse_vector/expected/gp_svec.out +++ b/gpcontrib/gp_sparse_vector/expected/gp_svec.out @@ -16,7 +16,7 @@ SELECT a,b::float8[] cross_product_equals FROM (SELECT a,b FROM test) foo WHERE DROP TABLE IF EXISTS test2; CREATE TABLE test2 AS SELECT * FROM test DISTRIBUTED BY (a); -- Test the plus operator (should be 9 rows) -SELECT (t1.b+t2.b)::float8[] cross_product_sum FROM test t1, test2 t2 ORDER BY t1.a; +SELECT (t1.b+t2.b)::float8[] cross_product_sum FROM test t1, test2 t2; cross_product_sum ------------------- {4,2,2,2,2,2} @@ -209,12 +209,6 @@ SELECT ('{1,2,3,4}:{3,4,5,6}'::svec)::float8[] - ('{1,2,3,4}:{3,4,5,6}'::svec) DROP TABLE IF EXISTS pivot_test; CREATE TABLE pivot_test(a float8) distributed randomly; INSERT INTO pivot_test VALUES (0),(1),(NULL),(2),(3); -SELECT array_agg(a) FROM pivot_test; - array_agg -------------------------- - {1,1,1,1,1}:{0,1,0,2,3} -(1 row) - SELECT l1norm(array_agg(a)) FROM pivot_test; l1norm -------- diff --git a/gpcontrib/gp_sparse_vector/sql/gp_svec.sql b/gpcontrib/gp_sparse_vector/sql/gp_svec.sql index 3760a5dee6..c5e1efcd12 100644 --- a/gpcontrib/gp_sparse_vector/sql/gp_svec.sql +++ b/gpcontrib/gp_sparse_vector/sql/gp_svec.sql @@ -13,7 +13,7 @@ SELECT a,b::float8[] cross_product_equals FROM (SELECT a,b FROM test) foo WHERE DROP TABLE IF EXISTS test2; CREATE TABLE test2 AS SELECT * FROM test DISTRIBUTED BY (a); -- Test the plus operator (should be 9 rows) -SELECT (t1.b+t2.b)::float8[] cross_product_sum FROM test t1, test2 t2 ORDER BY t1.a; +SELECT (t1.b+t2.b)::float8[] cross_product_sum FROM test t1, test2 t2; -- Test ORDER BY SELECT (t1.b+t2.b)::float8[] cross_product_sum, l2norm(t1.b+t2.b) l2norm, (t1.b+t2.b) sparse_vector FROM test t1, test2 t2 ORDER BY 3; @@ -70,7 +70,6 @@ SELECT ('{1,2,3,4}:{3,4,5,6}'::svec)::float8[] - ('{1,2,3,4}:{3,4,5,6}'::svec) DROP TABLE IF EXISTS pivot_test; CREATE TABLE pivot_test(a float8) distributed randomly; INSERT INTO pivot_test VALUES (0),(1),(NULL),(2),(3); -SELECT array_agg(a) FROM pivot_test; SELECT l1norm(array_agg(a)) FROM pivot_test; DROP TABLE IF EXISTS pivot_test; -- Answer should be 5 -- GitLab