提交 a2819b12 编写于 作者: E Ekta Khanna 提交者: khannaekta

Adding negative test for aggregate on set returning function

Test added for ORCA version v2.55.4
Signed-off-by: NHaisheng Yuan <hyuan@pivotal.io>
上级 0edb0937
[requires]
orca/v2.55.3@gpdb/stable
orca/v2.55.4@gpdb/stable
[imports]
include, * -> build/include
......
......@@ -121,7 +121,7 @@ sync_tools: opt_write_test /opt/releng/apache-ant
-Divyrepo.user=$(IVYREPO_USER) -Divyrepo.passwd="$(IVYREPO_PASSWD)" -quiet resolve);
ifeq "$(findstring aix,$(BLD_ARCH))" ""
LD_LIBRARY_PATH='' wget --no-check-certificate -q -O - https://github.com/greenplum-db/gporca/releases/download/v2.55.3/bin_orca_centos5_release.tar.gz | tar zxf - -C $(BLD_TOP)/ext/$(BLD_ARCH)
LD_LIBRARY_PATH='' wget --no-check-certificate -q -O - https://github.com/greenplum-db/gporca/releases/download/v2.55.4/bin_orca_centos5_release.tar.gz | tar zxf - -C $(BLD_TOP)/ext/$(BLD_ARCH)
endif
clean_tools: opt_write_test
......
......@@ -1588,6 +1588,21 @@ explain select string_agg(a) from mpp14125 group by b;
(8 rows)
-- end MPP-14125
-- Test unsupported ORCA feature: agg(set returning function)
CREATE TABLE tbl_agg_srf (foo int[]) DISTRIBUTED RANDOMLY;
INSERT INTO tbl_agg_srf VALUES (array[1,2,3]);
EXPLAIN SELECT count(unnest(foo)) FROM tbl_agg_srf;
QUERY PLAN
----------------------------------------------------------------------------------
Aggregate (cost=1.09..1.10 rows=1 width=8)
-> Gather Motion 3:1 (slice1; segments: 3) (cost=1.02..1.07 rows=1 width=8)
-> Aggregate (cost=1.02..1.03 rows=1 width=8)
-> Seq Scan on tbl_agg_srf (cost=0.00..1.01 rows=1 width=33)
Optimizer: legacy query optimizer
(5 rows)
SELECT count(unnest(foo)) FROM tbl_agg_srf;
ERROR: set-valued function called in context that cannot accept a set (seg0 slice1 127.0.0.1:25432 pid=43830)
-- CLEANUP
set client_min_messages='warning';
drop schema bfv_aggregate cascade;
......@@ -1588,6 +1588,21 @@ explain select string_agg(a) from mpp14125 group by b;
(10 rows)
-- end MPP-14125
-- Test unsupported ORCA feature: agg(set returning function)
CREATE TABLE tbl_agg_srf (foo int[]) DISTRIBUTED RANDOMLY;
INSERT INTO tbl_agg_srf VALUES (array[1,2,3]);
EXPLAIN SELECT count(unnest(foo)) FROM tbl_agg_srf;
QUERY PLAN
----------------------------------------------------------------------------------
Aggregate (cost=1.09..1.10 rows=1 width=8)
-> Gather Motion 3:1 (slice1; segments: 3) (cost=1.02..1.07 rows=1 width=8)
-> Aggregate (cost=1.02..1.03 rows=1 width=8)
-> Seq Scan on tbl_agg_srf (cost=0.00..1.01 rows=1 width=33)
Optimizer: legacy query optimizer
(5 rows)
SELECT count(unnest(foo)) FROM tbl_agg_srf;
ERROR: set-valued function called in context that cannot accept a set (seg1 slice1 127.0.0.1:25433 pid=43559)
-- CLEANUP
set client_min_messages='warning';
drop schema bfv_aggregate cascade;
......@@ -1390,6 +1390,12 @@ select array_agg(a order by b desc nulls last) from aggordertest;
create temp table mpp14125 as select repeat('a', a) a, a % 10 b from generate_series(1, 100)a;
explain select string_agg(a) from mpp14125 group by b;
-- end MPP-14125
-- Test unsupported ORCA feature: agg(set returning function)
CREATE TABLE tbl_agg_srf (foo int[]) DISTRIBUTED RANDOMLY;
INSERT INTO tbl_agg_srf VALUES (array[1,2,3]);
EXPLAIN SELECT count(unnest(foo)) FROM tbl_agg_srf;
SELECT count(unnest(foo)) FROM tbl_agg_srf;
-- CLEANUP
set client_min_messages='warning';
drop schema bfv_aggregate cascade;
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册