提交 ccfe82b7 编写于 作者: D Daniel Gustafsson

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: NHeikki Linnakangas <hlinnakangas@pivotal.io>
上级 0d4908ee
......@@ -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
--------
......
......@@ -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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册