Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
leiysky committed Aug 26, 2022
1 parent cdf3bc2 commit 03cbe9d
Show file tree
Hide file tree
Showing 7 changed files with 84 additions and 103 deletions.
20 changes: 10 additions & 10 deletions tests/logictest/suites/mode/cluster/exchange.test
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ explain select * from numbers(1) t, numbers(2) t1 where t.number = t1.number;
Exchange(Merge)
└── HashJoin: INNER, build keys: [t1.number (#1)], probe keys: [t.number (#0)], join filters: []
├── Exchange(Hash): keys: [t.number (#0)]
│ └── Scan: default.system.numbers, filters: []
│ └── Scan: default.system.numbers, filters: [], Sort: [none], limit: [none]
└── Exchange(Hash): keys: [t1.number (#1)]
└── Scan: default.system.numbers, filters: []
└── Scan: default.system.numbers, filters: [], Sort: [none], limit: [none]

statement query T
explain select * from numbers(1) t, numbers(2) t1, numbers(3) t2 where t.number = t1.number and t.number = t2.number;
Expand All @@ -17,11 +17,11 @@ Exchange(Merge)
└── HashJoin: INNER, build keys: [t2.number (#2)], probe keys: [t.number (#0)], join filters: []
├── HashJoin: INNER, build keys: [t1.number (#1)], probe keys: [t.number (#0)], join filters: []
│ ├── Exchange(Hash): keys: [t.number (#0)]
│ │ └── Scan: default.system.numbers, filters: []
│ │ └── Scan: default.system.numbers, filters: [], Sort: [none], limit: [none]
│ └── Exchange(Hash): keys: [t1.number (#1)]
│ └── Scan: default.system.numbers, filters: []
│ └── Scan: default.system.numbers, filters: [], Sort: [none], limit: [none]
└── Exchange(Hash): keys: [t2.number (#2)]
└── Scan: default.system.numbers, filters: []
└── Scan: default.system.numbers, filters: [], Sort: [none], limit: [none]

statement query T
explain select * from (select number as a, number+1 as b from numbers(1)) t, numbers(2) t1, numbers(3) t2 where a = t1.number and b = t2.number;
Expand All @@ -33,11 +33,11 @@ Exchange(Merge)
│ └── HashJoin: INNER, build keys: [t1.number (#3)], probe keys: [t.a (#0)], join filters: []
│ ├── Exchange(Hash): keys: [t.a (#0)]
│ │ └── EvalScalar: [+(numbers.number (#0), 1)]
│ │ └── Scan: default.system.numbers, filters: []
│ │ └── Scan: default.system.numbers, filters: [], Sort: [none], limit: [none]
│ └── Exchange(Hash): keys: [t1.number (#3)]
│ └── Scan: default.system.numbers, filters: []
│ └── Scan: default.system.numbers, filters: [], Sort: [none], limit: [none]
└── Exchange(Hash): keys: [t2.number (#4)]
└── Scan: default.system.numbers, filters: []
└── Scan: default.system.numbers, filters: [], Sort: [none], limit: [none]

statement query T
explain select * from (select sum(number) as number from numbers(1) group by number) t, numbers(2) t1 where t.number = t1.number;
Expand All @@ -51,7 +51,7 @@ Exchange(Merge)
│ └── Aggregate(Final): group items: [numbers.number (#0)], aggregate functions: [sum(number)]
│ └── Aggregate(Partial): group items: [numbers.number (#0)], aggregate functions: [sum(number)]
│ └── Exchange(Hash): keys: [numbers.number (#0)]
│ └── Scan: default.system.numbers, filters: []
│ └── Scan: default.system.numbers, filters: [], Sort: [none], limit: [none]
└── Exchange(Hash): keys: [t1.number (#4)]
└── Scan: default.system.numbers, filters: []
└── Scan: default.system.numbers, filters: [], Sort: [none], limit: [none]

22 changes: 1 addition & 21 deletions tests/logictest/suites/mode/standalone/explain/explain.test
Original file line number Diff line number Diff line change
@@ -1,22 +1,15 @@
-- TODO(need fix)

onlyif mysql
statement ok
drop table if exists t1 all;

onlyif mysql
statement ok
drop table if exists t2 all;

onlyif mysql
statement ok
create table t1(a int, b int);

onlyif mysql
statement ok
create table t2(a int, b int);

onlyif mysql
statement query T
explain select t1.a from t1 where a > 0;

Expand All @@ -25,7 +18,6 @@ Project: [a (#0)]
└── Filter: [t1.a (#0) > 0]
└── Scan: default.default.t1, filters: [t1.a (#0) > 0], Sort: [none], limit: [none]

onlyif mysql
statement query T
explain select * from t1, t2 where (t1.a = t2.a and t1.a > 3) or (t1.a = t2.a and t2.a > 5 and t1.a > 1);

Expand All @@ -35,7 +27,6 @@ Filter: [(t1.a (#0) > 3) OR ((t2.a (#2) > 5) AND (t1.a (#0) > 1))]
├── Scan: default.default.t1, filters: [], Sort: [none], limit: [none]
└── Scan: default.default.t2, filters: [], Sort: [none], limit: [none]

onlyif mysql
statement query T
explain select * from t1, t2 where (t1.a = t2.a and t1.a > 3) or (t1.a = t2.a);

Expand All @@ -44,7 +35,6 @@ HashJoin: INNER, build keys: [t2.a (#2)], probe keys: [t1.a (#0)], join filters:
├── Scan: default.default.t1, filters: [], Sort: [none], limit: [none]
└── Scan: default.default.t2, filters: [], Sort: [none], limit: [none]

onlyif mysql
statement query T
explain raw select * from t1, t2 where (t1.a = t2.a and t1.a > 3) or (t1.a = t2.a);

Expand All @@ -56,7 +46,6 @@ Project: [a (#0),b (#1),a (#2),b (#3)]
├── LogicalGet: default.default.t1, Sort: [none], limit: [none]
└── LogicalGet: default.default.t2, Sort: [none], limit: [none]

onlyif mysql
statement query T
explain raw select * from t1 inner join t2 on t1.a = t2.a and t1.b = t2.b and t1.a > 2;

Expand All @@ -67,7 +56,6 @@ Project: [a (#0),b (#1),a (#2),b (#3)]
├── LogicalGet: default.default.t1, Sort: [none], limit: [none]
└── LogicalGet: default.default.t2, Sort: [none], limit: [none]

onlyif mysql
statement query T
explain syntax select 1, 'ab', [1,2,3], (1, 'a');

Expand All @@ -78,7 +66,6 @@ SELECT
[1, 2, 3],
(1, 'a')

onlyif mysql
statement query T
explain syntax select a, sum(b) as sum from t1 where a in (1, 2) and b > 0 and b < 100 group by a order by a;

Expand All @@ -95,7 +82,6 @@ WHERE
GROUP BY a
ORDER BY a

onlyif mysql
statement query T
explain syntax select * from t1 inner join t2 on t1.a = t2.a and t1.b = t2.b and t1.a > 2;

Expand All @@ -107,7 +93,6 @@ FROM
AND t1.b = t2.b
AND t1.a > 2

onlyif mysql
statement query T
explain syntax delete from t1 where a > 100 and b > 1 and b < 10;

Expand All @@ -119,7 +104,6 @@ WHERE
AND b > 1
AND b < 10

onlyif mysql
statement query T
explain syntax copy into t1 from 's3://mybucket/data.csv' file_format = ( type = 'CSV' field_delimiter = ',' record_delimiter = '\n' skip_header = 1) size_limit=10;

Expand All @@ -135,7 +119,6 @@ FILE_FORMAT = (
)
SIZE_LIMIT = 10

onlyif mysql
statement query T
explain syntax copy into 's3://mybucket/data.csv' from t1 file_format = ( type = 'CSV' field_delimiter = ',' record_delimiter = '\n' skip_header = 1) size_limit=10;

Expand All @@ -151,7 +134,6 @@ FILE_FORMAT = (
)
SIZE_LIMIT = 10

onlyif mysql
statement query T
explain syntax create table t3(a int64, b uint64, c float64, d string, e array(int32), f tuple(f1 bool, f2 string)) engine=fuse cluster by (a, b, c) comment='test' compression='LZ4';

Expand All @@ -172,7 +154,6 @@ CLUSTER BY (
comment = 'test',
compression = 'LZ4'

onlyif mysql
statement query T
explain syntax create view v as select number % 3 as a from numbers(100) where number > 10;

Expand All @@ -185,10 +166,9 @@ AS
WHERE
number > 10

onlyif mysql
statement ok
drop table t1;

onlyif mysql
statement ok
drop table t2;

26 changes: 13 additions & 13 deletions tests/logictest/suites/mode/standalone/explain/join.test
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@ explain select t.number from numbers(1) as t, numbers(1) as t1 where t.number =
----
Project: [number (#0)]
└── HashJoin: INNER, build keys: [t1.number (#1)], probe keys: [t.number (#0)], join filters: []
├── Scan: default.system.numbers, filters: []
└── Scan: default.system.numbers, filters: []
├── Scan: default.system.numbers, filters: [], Sort: [none], limit: [none]
└── Scan: default.system.numbers, filters: [], Sort: [none], limit: [none]

statement query T
explain select t.number from numbers(1) as t, numbers(1) as t1 where t.number = t1.number and t.number = t1.number + 1;

----
Project: [number (#0)]
└── HashJoin: INNER, build keys: [t1.number (#1), +(t1.number (#1), 1)], probe keys: [t.number (#0), t.number (#0)], join filters: []
├── Scan: default.system.numbers, filters: []
└── Scan: default.system.numbers, filters: []
├── Scan: default.system.numbers, filters: [], Sort: [none], limit: [none]
└── Scan: default.system.numbers, filters: [], Sort: [none], limit: [none]

statement query T
explain select t.number from numbers(1) as t, numbers(1) as t1 where t.number > 1 and 1 < t1.number;
Expand All @@ -23,9 +23,9 @@ explain select t.number from numbers(1) as t, numbers(1) as t1 where t.number >
Project: [number (#0)]
└── CrossJoin
├── Filter: [t.number (#0) > 1]
│ └── Scan: default.system.numbers, filters: [t.number (#0) > 1]
│ └── Scan: default.system.numbers, filters: [t.number (#0) > 1], Sort: [none], limit: [none]
└── Filter: [1 < t1.number (#1)]
└── Scan: default.system.numbers, filters: [1 < t1.number (#1)]
└── Scan: default.system.numbers, filters: [1 < t1.number (#1)], Sort: [none], limit: [none]

statement query T
explain select t.number from numbers(1) as t, numbers(1) as t1 where t.number + t1.number = 1;
Expand All @@ -34,17 +34,17 @@ explain select t.number from numbers(1) as t, numbers(1) as t1 where t.number +
Project: [number (#0)]
└── Filter: [+(t.number (#0), t1.number (#1)) = 1]
└── CrossJoin
├── Scan: default.system.numbers, filters: []
└── Scan: default.system.numbers, filters: []
├── Scan: default.system.numbers, filters: [], Sort: [none], limit: [none]
└── Scan: default.system.numbers, filters: [], Sort: [none], limit: [none]

statement query T
explain select t.number from numbers(1) as t, numbers(1) as t1 where t.number = cast(t1.number as string);

----
Project: [number (#0)]
└── HashJoin: INNER, build keys: [CAST(CAST(t1.number (#1) AS VARCHAR) AS DOUBLE)], probe keys: [CAST(t.number (#0) AS DOUBLE)], join filters: []
├── Scan: default.system.numbers, filters: []
└── Scan: default.system.numbers, filters: []
├── Scan: default.system.numbers, filters: [], Sort: [none], limit: [none]
└── Scan: default.system.numbers, filters: [], Sort: [none], limit: [none]

statement query T
explain select t.number from numbers(1) as t, numbers(1) as t1, numbers(1) as t2 where t1.number = t2.number and t.number = 1;
Expand All @@ -54,7 +54,7 @@ Project: [number (#0)]
└── HashJoin: INNER, build keys: [t2.number (#2)], probe keys: [t1.number (#1)], join filters: []
├── CrossJoin
│ ├── Filter: [t.number (#0) = 1]
│ │ └── Scan: default.system.numbers, filters: [t.number (#0) = 1]
│ └── Scan: default.system.numbers, filters: []
└── Scan: default.system.numbers, filters: []
│ │ └── Scan: default.system.numbers, filters: [t.number (#0) = 1], Sort: [none], limit: [none]
│ └── Scan: default.system.numbers, filters: [], Sort: [none], limit: [none]
└── Scan: default.system.numbers, filters: [], Sort: [none], limit: [none]

1 change: 1 addition & 0 deletions tests/logictest/suites/mode/standalone/explain/limit.test
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,4 @@ Limit: [1], Offset: [0]
└── Aggregate(Final): group items: [t.number (#4)], aggregate functions: [count(t.number)]
└── Aggregate(Partial): group items: [t.number (#4)], aggregate functions: [count(t.number)]
└── Scan: default.system.numbers, filters: [], Sort: [none], limit: [none]

30 changes: 15 additions & 15 deletions tests/logictest/suites/mode/standalone/explain/prune_column.test
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ explain select * from (select a from (select number as a, number + 1 as b from n

----
Project: [number (#0)]
└── Scan: default.system.numbers, filters: []
└── Scan: default.system.numbers, filters: [], Sort: [none], limit: [none]

statement query T
explain select a from (select number as a, count(*) as b from numbers(1) group by a);
Expand All @@ -12,20 +12,20 @@ explain select a from (select number as a, count(*) as b from numbers(1) group b
Project: [number (#0)]
└── Aggregate(Final): group items: [numbers.number (#0)], aggregate functions: []
└── Aggregate(Partial): group items: [numbers.number (#0)], aggregate functions: []
└── Scan: default.system.numbers, filters: []
└── Scan: default.system.numbers, filters: [], Sort: [none], limit: [none]

statement query T
explain select a from (select number as a, number b, sum(number) as c, number as d, number as e from numbers(1) group by a, b, d, e) where b > 1 order by d limit 1;

----
Limit: [1], Offset: [0]
└── Project: [number (#0)]
└── Sort: [number (#0) ASC]
Project: [number (#0)]
└── Limit: [1], Offset: [0]
└── Sort: [number (#0) ASC], limit: [1]
└── Project: [number (#0)]
└── Filter: [numbers.b (#0) > 1]
└── Aggregate(Final): group items: [numbers.number (#0), numbers.number (#0), numbers.number (#0), numbers.number (#0)], aggregate functions: []
└── Aggregate(Partial): group items: [numbers.number (#0), numbers.number (#0), numbers.number (#0), numbers.number (#0)], aggregate functions: []
└── Scan: default.system.numbers, filters: []
└── Scan: default.system.numbers, filters: [], Sort: [none], limit: [none]

statement query T
explain select * from (select t1.a from (select number + 1 as a, number + 1 as b, number + 1 as c, number + 1 as d from numbers(1)) as t1, (select number + 1 as a, number + 1 as b, number + 1 as c from numbers(1)) as t2 where t1.b = t2.b and t1.c = 1);
Expand All @@ -36,10 +36,10 @@ Project: [a (#1)]
├── Project: [a (#1),b (#2)]
│ └── Filter: [t1.c (#3) = 1]
│ └── EvalScalar: [+(numbers.number (#0), 1), +(numbers.number (#0), 1), +(numbers.number (#0), 1)]
│ └── Scan: default.system.numbers, filters: []
│ └── Scan: default.system.numbers, filters: [], Sort: [none], limit: [none]
└── Project: [b (#11)]
└── EvalScalar: [+(numbers.number (#9), 1)]
└── Scan: default.system.numbers, filters: []
└── Scan: default.system.numbers, filters: [], Sort: [none], limit: [none]

statement query T
explain select t1.a from (select number + 1 as a, number + 1 as b from numbers(1)) as t1 where t1.a = (select count(*) from (select t2.a, t3.a from (select number + 1 as a, number + 1 as b, number + 1 as c, number + 1 as d from numbers(1)) as t2, (select number + 1 as a, number + 1 as b, number + 1 as c from numbers(1)) as t3 where t2.b = t3.b and t2.c = 1));
Expand All @@ -50,7 +50,7 @@ Project: [a (#1)]
└── HashJoin: SINGLE, build keys: [], probe keys: [], join filters: []
├── Project: [a (#1)]
│ └── EvalScalar: [+(numbers.number (#0), 1)]
│ └── Scan: default.system.numbers, filters: []
│ └── Scan: default.system.numbers, filters: [], Sort: [none], limit: [none]
└── Project: [COUNT(*) (#21)]
└── EvalScalar: [COUNT(*) (#22)]
└── Aggregate(Final): group items: [], aggregate functions: [COUNT(*)]
Expand All @@ -60,18 +60,18 @@ Project: [a (#1)]
├── Project: [a (#6),b (#7)]
│ └── Filter: [t2.c (#8) = 1]
│ └── EvalScalar: [+(numbers.number (#5), 1), +(numbers.number (#5), 1), +(numbers.number (#5), 1)]
│ └── Scan: default.system.numbers, filters: []
│ └── Scan: default.system.numbers, filters: [], Sort: [none], limit: [none]
└── Project: [b (#16)]
└── EvalScalar: [+(numbers.number (#14), 1)]
└── Scan: default.system.numbers, filters: []
└── Scan: default.system.numbers, filters: [], Sort: [none], limit: [none]

statement query T
explain select name from system.functions order by example;

----
Project: [name (#0)]
└── Sort: [example (#7) ASC]
└── Scan: default.system.functions, filters: []
└── Sort: [example (#7) ASC], limit: [none]
└── Scan: default.system.functions, filters: [], Sort: [example (#7) ASC], limit: [none]

statement query T
explain select t.number from numbers(10) t where exists(select * from numbers(10));
Expand All @@ -85,6 +85,6 @@ Project: [number (#0)]
│ └── Aggregate(Final): group items: [], aggregate functions: [count(*)]
│ └── Aggregate(Partial): group items: [], aggregate functions: [count(*)]
│ └── Limit: [1], Offset: [0]
│ └── Scan: default.system.numbers, filters: []
└── Scan: default.system.numbers, filters: []
│ └── Scan: default.system.numbers, filters: [], Sort: [none], limit: [1]
└── Scan: default.system.numbers, filters: [], Sort: [none], limit: [none]

Loading

0 comments on commit 03cbe9d

Please sign in to comment.