Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: regenerate & format slt tests #6776

Merged
merged 5 commits into from
Dec 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion e2e_test/batch/aggregate/avg.slt.part
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

statement ok
SET RW_IMPLICIT_FLUSH TO true;

Expand Down
1 change: 1 addition & 0 deletions e2e_test/batch/aggregate/distinct.slt.part
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ select distinct sum(v1) from t group by v2;
5

# v2, v3 can be either 2, 3 or 3, 2

query I
select distinct on(v1) v2 + v3 from t order by v1;
----
Expand Down
3 changes: 1 addition & 2 deletions e2e_test/batch/aggregate/selective_distinct_agg.slt.part
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ with z(a, b) as (select count(distinct v1), count(v2) from t) select a from z;
statement ok
drop table t


statement ok
create table t(x int, y int)

Expand All @@ -53,4 +52,4 @@ select count(distinct x) filter (where y > 0), sum(distinct y) from t;
1 3

statement ok
drop table t
drop table t
3 changes: 1 addition & 2 deletions e2e_test/batch/aggregate/sort_agg.slt.part
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ select v1, max(v2) from mv group by v1
4 7
9 3


query II
select v1, max(v2) from t group by v1 order by v1 desc
----
Expand All @@ -35,4 +34,4 @@ statement ok
drop materialized view mv

statement ok
drop table t
drop table t
10 changes: 5 additions & 5 deletions e2e_test/batch/aggregate/timestamp.slt.part
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ insert into t1 values
query IT rowsort
select sum(v), created_at from t1 group by created_at;
----
3 2022-01-01 11:02:00
1 2022-01-01 10:52:00
5 2022-01-01 10:33:00
3 2022-01-01 10:15:00
4 2022-01-01 10:00:00
1 2022-01-01 10:52:00
3 2022-01-01 10:15:00
3 2022-01-01 11:02:00
4 2022-01-01 10:00:00
5 2022-01-01 10:33:00

statement ok
drop table t1;
9 changes: 9 additions & 0 deletions e2e_test/batch/basic/array.slt.part
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ drop table t;
## Test single quote style array syntax.

# Test assign cast.

statement ok
create table t(arr int[]);

Expand All @@ -111,6 +112,7 @@ statement ok
drop table t;

# Test explicit and implicit cast

query T
select pg_typeof(arr) from (values ('{1, 2, 3}'::integer[]), ('{4, 5, 6}')) as t(arr);
----
Expand All @@ -124,27 +126,31 @@ integer[]
integer[]

# Test explicit cast to float array

query T
select pg_typeof(arr::float[]) from (values ('{1, 2, 3}'), ('{4, 5, 6}')) as t(arr);
----
double precision[]
double precision[]

# Test explicit cast to varchar array

query T
select pg_typeof(arr::varchar[]) from (values ('{1, 2, 3}'), ('{4, 5, 6}')) as t(arr);
----
varchar[]
varchar[]

# Test explicit cast to nested integer array

query T
select pg_typeof(arr::integer[][]) from (values ('{{1}, {2}, {3}}'), ('{{4}, {5}, {6}}')) as t(arr);
----
integer[][]
integer[][]

# Test explicit cast to varchar array. Varchar values should be trimmed

query T
select (arr::varchar[])[1] from (values ('{ 1 b ?, 2, 3}'), ('{ 4 a , 5, 6}')) as t(arr);
----
Expand All @@ -157,6 +163,7 @@ select pg_typeof((v1::integer[][])[2][1]), (v1::integer[][])[2][1] from (values
integer 2

# Test multiple castings of the same input.

query TTI
select
(arr::varchar[][])[1][2] as double_varchar,
Expand All @@ -167,12 +174,14 @@ from (values ('{{{1, 2, 3}, {44, 55, 66}}}')) as t(arr);
{44, 55, 66} 66 66

# Test cast from array to string

query T
select array['a', 'b']::varchar;
----
{a,b}

# Test array display with quoting

query T
select array['hello', '', null, 'nULl', 'nULlx', 'aa"bb', 'mm\nn', 'uu,vv', 'yy zz'];
----
Expand Down
7 changes: 4 additions & 3 deletions e2e_test/batch/basic/array_access.slt.part
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,15 @@ select (ARRAY['foo', 'bar'])[3];
----
NULL

statement error
statement error
select (ARRAY['foo', 'bar'])[];

# array access is not possible for non-composite types
statement error

statement error
select (1::INT)[1];

statement error
statement error
select ('a'::VARCHAR)[1];

query T
Expand Down
5 changes: 1 addition & 4 deletions e2e_test/batch/basic/basic.slt.part
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ values(1+2*3)
----
7

statement error
statement error
values(CAST('abc' AS BOOLEAN))

query I
Expand All @@ -27,13 +27,10 @@ select 1+2*3, 4*5;
statement ok
start transaction;


statement ok
abort;

query I
show RW_IMPLICIT_FLUSH;
----
true


10 changes: 4 additions & 6 deletions e2e_test/batch/basic/boolean.slt.part
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,9 @@ SELECT v1 is true,
v1 is null
FROM TB1;
----
t f f t f
f t t f f
f t f t t


f t f t t
f t t f f
t f f t f

statement ok
DROP TABLE TB1;
Expand Down Expand Up @@ -126,4 +124,4 @@ select booleq(true,true),
boolne('true'::bool,false),
boolne('true'::bool,true);
----
t f f t f t t f t t f
t f f t f t t f t t f
1 change: 0 additions & 1 deletion e2e_test/batch/basic/const.slt.part
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,3 @@ select 42 having 2 > 1;
query I
select 42 having 2 < 1;
----

2 changes: 1 addition & 1 deletion e2e_test/batch/basic/cte.slt.part
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ with cte as (select v3, v4 from t2) select t1.v1 from t1 inner join cte on t1.v2
query I rowsort
with cte1 as (select v3, v4 from t2), cte2 as (select v3 from cte1) select v3 from cte2;
----
3
1
3

query II
with t1 as (values(100, 200)) select * from t1;
Expand Down
4 changes: 1 addition & 3 deletions e2e_test/batch/basic/func.slt.part
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ create table t (v1 int);
statement ok
create table b (b1 int, b2 int);


statement ok
insert into t values (2);

Expand Down Expand Up @@ -148,7 +147,6 @@ select concat_ws(v1, v2, v3, v4, v5, v6, v7, v8) from t;
----
1,2,3.01,4,5.01,t


statement ok
drop table t;

Expand Down Expand Up @@ -177,7 +175,6 @@ select split_part('abc,def,ghi,jkl', ',', -2);
----
ghi


query I
select char_length('hello world');
----
Expand Down Expand Up @@ -269,6 +266,7 @@ select pg_typeof(array[1, 2]);
integer[]

# Note that PostgreSQL still displays `integer[]` in this case.

query T
select pg_typeof(array[array[1, 2], array[3, 4]]);
----
Expand Down
2 changes: 1 addition & 1 deletion e2e_test/batch/basic/generate_series.slt.part
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ SELECT * FROM generate_series('10'::INT,'2'::INT,'-2'::INT);
4
2

statement error
statement error
SELECT * FROM generate_series('2'::INT,'10'::INT,'0'::INT);

query I
Expand Down
2 changes: 1 addition & 1 deletion e2e_test/batch/basic/index.slt.part
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,4 @@ select v1,v2 from t1 order by v1, v2;
5 6

statement ok
drop table t1;
drop table t1;
2 changes: 1 addition & 1 deletion e2e_test/batch/basic/index_join.slt.part
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,4 @@ statement ok
drop table t;

statement ok
drop table t2;
drop table t2;
48 changes: 23 additions & 25 deletions e2e_test/batch/basic/insert_expr.slt.part
Original file line number Diff line number Diff line change
Expand Up @@ -54,17 +54,17 @@ insert into t values (12), (6+7), (44);
query I rowsort
select * from t;
----
12
13
3
4
44
5
6
7
7
8
9
12
13
44

statement ok
drop table t;
Expand All @@ -88,54 +88,54 @@ insert into t (v1, v2, v3) values (1, 2, 3);
query I rowsort
select * from t;
----
1 3 2
1 2 3
1 2 3
1 3 2

statement ok
insert into t (v2, v1, v3) values (1, 2, 3);

query I rowsort
select * from t;
----
1 3 2
1 2 3
2 1 3
1 2 3
1 3 2
2 1 3

statement ok
insert into t (v2, v3, v1) values (1, 2, 3);

query I rowsort
select * from t;
----
1 3 2
1 2 3
2 1 3
3 1 2
1 2 3
1 3 2
2 1 3
3 1 2

statement ok
insert into t (v3, v1, v2) values (1, 2, 3);

query I rowsort
select * from t;
----
1 3 2
1 2 3
2 1 3
3 1 2
2 3 1
1 2 3
1 3 2
2 1 3
2 3 1
3 1 2

statement ok
insert into t (v3, v2, v1) values (1, 2, 3);

query I rowsort
select * from t;
----
1 3 2
1 2 3
2 1 3
3 1 2
2 3 1
3 2 1
1 2 3
1 3 2
2 1 3
2 3 1
3 1 2
3 2 1

# column and table names have to be case insensitive

Expand Down Expand Up @@ -251,8 +251,6 @@ select * from t;
statement ok
drop table t;



statement ok
create table t (v1 int, v2 int, v3 int);

Expand Down
2 changes: 1 addition & 1 deletion e2e_test/batch/basic/insert_with_join.slt.part
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ statement ok
drop table t2;

statement ok
drop table t3;
drop table t3;
2 changes: 1 addition & 1 deletion e2e_test/batch/basic/join.slt.part
Original file line number Diff line number Diff line change
Expand Up @@ -85,4 +85,4 @@ statement ok
drop index i;

statement ok
drop table t;
drop table t;
Loading