Skip to content

Commit

Permalink
bug: fix ePQ plpython cases
Browse files Browse the repository at this point in the history
  • Loading branch information
mrdrivingduck committed Mar 10, 2024
1 parent f6e0c49 commit ffb3160
Show file tree
Hide file tree
Showing 11 changed files with 154 additions and 139 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/regression-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
container_image: [ centos7, ubuntu20.04, ubuntu22.04 ]
container_image: [ ubuntu20.04, ubuntu22.04 ]
instance_type: [ oltp, htap ]
steps:
- name: Fetch PolarDB source code
Expand Down
4 changes: 2 additions & 2 deletions src/test/regress/px_expected/polar-px-dev/bfv_aggregate.out
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ select f3, array_sort(myaggp20a(f1)) from t group by f3 order by f3;
(3 rows)

-- start_ignore
create language plpythonu;
create language plpython3u;
-- end_ignore
create or replace function count_operator(query text, operator text) returns int as
$$
Expand All @@ -304,7 +304,7 @@ for i in range(len(rv)):
result = result+1
return result
$$
language plpythonu;
language plpython3u;
--
-- Testing adding a traceflag to favor multi-stage aggregation
--
Expand Down
6 changes: 3 additions & 3 deletions src/test/regress/px_expected/polar-px-dev/bfv_index.out
Original file line number Diff line number Diff line change
Expand Up @@ -296,8 +296,8 @@ AND ft.id = dt1.id;
(30 rows)

-- start_ignore
create language plpythonu;
ERROR: language "plpythonu" already exists
create language plpython3u;
ERROR: language "plpython3u" already exists
-- end_ignore
create or replace function count_index_scans(explain_query text) returns int as
$$
Expand All @@ -310,7 +310,7 @@ for i in range(len(rv)):
result = result+1
return result
$$
language plpythonu;
language plpython3u;
DROP TABLE bfv_tab1;
DROP TABLE bfv_tab2_facttable1;
DROP TABLE bfv_tab2_dimdate;
Expand Down
251 changes: 137 additions & 114 deletions src/test/regress/px_expected/polar-px-dev/bfv_partition_plans.out

Large diffs are not rendered by default.

10 changes: 1 addition & 9 deletions src/test/regress/px_expected/polar-px-dev/gporca.out
Original file line number Diff line number Diff line change
Expand Up @@ -16145,7 +16145,7 @@ drop table can_set_tag_target;
drop table can_set_tag_audit;
-- start_ignore
create language plpython3u;
ERROR: could not access file "$libdir/plpython3": No such file or directory
ERROR: language "plpython3u" already exists
-- end_ignore
-- Checking if ORCA uses parser's canSetTag for CREATE TABLE AS SELECT
create or replace function canSetTag_Func(x int) returns int as $$
Expand All @@ -16154,8 +16154,6 @@ create or replace function canSetTag_Func(x int) returns int as $$
else:
return x * 3
$$ language plpython3u;
ERROR: language "plpython3u" does not exist
HINT: Use CREATE EXTENSION to load the language into the database.
create table canSetTag_input_data (domain integer, class integer, attr text, value integer)
;
insert into canSetTag_input_data values(1, 1, 'A', 1);
Expand All @@ -16164,14 +16162,8 @@ insert into canSetTag_input_data values(3, 0, 'B', 1);
create table canSetTag_bug_table as
SELECT attr, class, (select canSetTag_Func(count(distinct class)::int) from canSetTag_input_data)
as dclass FROM canSetTag_input_data GROUP BY attr, class ;
ERROR: function cansettag_func(integer) does not exist
LINE 2: SELECT attr, class, (select canSetTag_Func(count(distinct cl...
^
HINT: No function matches the given name and argument types. You might need to add explicit type casts.
drop function canSetTag_Func(x int);
ERROR: function cansettag_func(integer) does not exist
drop table canSetTag_bug_table;
ERROR: table "cansettag_bug_table" does not exist
drop table canSetTag_input_data;
-- Test B-Tree index scan with in list
CREATE TABLE btree_test as SELECT i a, i b FROM generate_series(1,100) i ;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ set search_path='qp_with_functional_inlining';
-- end_matchsubs
-- start_ignore
/*--EXPLAIN_QUERY_BEGIN*/
CREATE LANGUAGE plpythonu;
psql:sql/polar-px-dev/qp_with_functional.sql:40: ERROR: language "plpythonu" already exists
CREATE LANGUAGE plpython3u;
psql:sql/polar-px-dev/qp_with_functional.sql:40: ERROR: language "plpython3u" already exists
-- end_ignore
CREATE TABLE foo AS SELECT i as a, i+1 as b from generate_series(1,10)i;
CREATE TABLE bar AS SELECT i as c, i+1 as d from generate_series(1,10)i;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ set search_path='qp_with_functional_noinlining';
-- end_matchsubs
-- start_ignore
/*--EXPLAIN_QUERY_BEGIN*/
CREATE LANGUAGE plpythonu;
psql:sql/polar-px-dev/qp_with_functional.sql:40: ERROR: language "plpythonu" already exists
CREATE LANGUAGE plpython3u;
psql:sql/polar-px-dev/qp_with_functional.sql:40: ERROR: language "plpython3u" already exists
-- end_ignore
CREATE TABLE foo AS SELECT i as a, i+1 as b from generate_series(1,10)i;
CREATE TABLE bar AS SELECT i as c, i+1 as d from generate_series(1,10)i;
Expand Down
4 changes: 2 additions & 2 deletions src/test/regress/sql/polar-px-dev/bfv_aggregate.sql
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ insert into t values(3,array[3],'b');
select f3, array_sort(myaggp20a(f1)) from t group by f3 order by f3;

-- start_ignore
create language plpythonu;
create language plpython3u;
-- end_ignore
create or replace function count_operator(query text, operator text) returns int as
$$
Expand All @@ -105,7 +105,7 @@ for i in range(len(rv)):
result = result+1
return result
$$
language plpythonu;
language plpython3u;

--
-- Testing adding a traceflag to favor multi-stage aggregation
Expand Down
4 changes: 2 additions & 2 deletions src/test/regress/sql/polar-px-dev/bfv_index.sql
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ WHERE ft.wk_id = dt.wk_id
AND ft.id = dt1.id;

-- start_ignore
create language plpythonu;
create language plpython3u;
-- end_ignore

create or replace function count_index_scans(explain_query text) returns int as
Expand All @@ -135,7 +135,7 @@ for i in range(len(rv)):
result = result+1
return result
$$
language plpythonu;
language plpython3u;

DROP TABLE bfv_tab1;
DROP TABLE bfv_tab2_facttable1;
Expand Down
2 changes: 1 addition & 1 deletion src/test/regress/sql/polar-px-dev/bfv_partition_plans.sql
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ set search_path=bfv_partition_plans;
-- Initial setup for all the partitioning test for this suite
--
-- start_ignore
CREATE LANGUAGE plpythonu;
CREATE LANGUAGE plpython3u;
-- end_ignore

create or replace function count_operator(query text, operator text) returns int as
Expand Down
2 changes: 1 addition & 1 deletion src/test/regress/sql/polar-px-dev/qp_with_functional.sql
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@

-- start_ignore
/*--EXPLAIN_QUERY_BEGIN*/
CREATE LANGUAGE plpythonu;
CREATE LANGUAGE plpython3u;
-- end_ignore

CREATE TABLE foo AS SELECT i as a, i+1 as b from generate_series(1,10)i;
Expand Down

0 comments on commit ffb3160

Please sign in to comment.