Skip to content

Commit

Permalink
Add the test fixture
Browse files Browse the repository at this point in the history
  • Loading branch information
Wenrui Meng committed Oct 28, 2021
1 parent 9929386 commit 097a734
Show file tree
Hide file tree
Showing 307 changed files with 1,900 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
select max(upper(`c_string`)), min(upper(`c_string`))
from `datatype`
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
select `timezone_hour`(`at_timezone`(timestamp '2001-08-22 03:04:05.3', 'asia/oral')), `timezone_minute`(`at_timezone`(timestamp '2001-08-22 03:04:05.3', 'asia/oral'))
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
select `timezone_hour`(`at_timezone`(timestamp '2001-08-22 03:04:05.3', 'asia/oral')), `timezone_minute`(`at_timezone`(timestamp '2001-08-22 03:04:05.3', 'asia/oral'))
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
select avg(distinct `c_bigint`), avg(distinct `c_double`)
from `datatype`
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
select avg(`c_bigint`), avg(`c_double`)
from `datatype`
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
select `bar`(1, 10), `bar`(1, 10, `rgb`(255, 0, 0), `color`('#0f0'))
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
select cast(10 as varchar(65535) character set `iso-8859-1`)
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
select count(*)
from `tpch`.`tiny`.`customer`
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
select count(distinct `c2`) as `cnt`
from `empty`
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
select count(distinct `c1`) as `cnt`
from `empty`
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
select count(distinct `c_bigint`), count(distinct `c_double`), count(distinct `c_string`), count(distinct `c_date`), count(distinct `c_timestamp`), count(distinct `c_boolean`)
from `datatype`
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
select count(*)
from `tpch`.`tiny`.`lineitem`
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
select count(*)
from `tpch`.`tiny`.`nation`
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
select count(*)
from `tpch`.`tiny`.`orders`
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
select count(*)
from `tpch`.`tiny`.`part`
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
select count(*)
from `tpch`.`tiny`.`partsupp`
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
select count(*)
from `tpch`.`tiny`.`region`
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
select count(*)
from `tpch`.`tiny`.`supplier`
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
select count(`c_bigint`), count(`c_double`), count(`c_string`), count(`c_date`), count(`c_timestamp`), count(`c_boolean`)
from `datatype`
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
select `n_name`, `r_name`
from `nation`
cross join `region`
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
select date '2012-08-08' + interval '2' day, time '01:00:00.0' + interval '3' hour, timestamp '2012-08-08 01:00:00.0' + interval '29' hour, timestamp '2012-10-31 01:00:00.0' + interval '1' month, interval '2' day + interval '3' hour, interval '3' year + interval '5' month, date '2012-08-08' - interval '2' day, time '01:00:00.0' - interval '3' hour, timestamp '2012-08-08 01:00:00.0' - interval '29' hour, timestamp '2012-10-31 01:00:00.0' - interval '1' month, interval '2' day - interval '3' hour, interval '3' year - interval '5' month
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
select `n_name`
from `nation`
where `n_nationkey` = 17
except
select `n_name`
from `nation`
where `n_regionkey` = 2
union
select `n_name`
from `nation`
where `n_regionkey` = 2
intersect
select `n_name`
from `nation`
where `n_nationkey` > 15
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
select `p_partkey`, `n_name`
from `nation`
inner join `part` on `n_nationkey` = `p_partkey`
where `n_name` < `p_name`
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
select `n_name`, `r_name`
from `nation`
inner join `region` on `nation`.`n_regionkey` = `region`.`r_regionkey`
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
select count(*)
from `nation`
inner join `region` on `nation`.`n_regionkey` = `region`.`r_regionkey`
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
select *
from `nation`
inner join `region` on `nation`.`n_regionkey` = `region`.`r_regionkey`
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
select `n_name`, `r_name`
from `nation`
inner join `region` on `nation`.`n_regionkey` = `region`.`r_regionkey`
where `n_name` > 'e'
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
select `p_partkey`, `n_name`
from `nation`
left join `part` on `n_nationkey` = `p_partkey`
where `n_name` < `p_name`
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
select extract(day from timestamp '2001-08-22 03:04:05.3')
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
select `p_partkey`, `n_name`, `r_name`
from `nation`
inner join `part` on `r_regionkey` = `p_partkey`
where `n_nationkey` = `r_regionkey`
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
select `p_partkey`, `n_name`, `r_name`
from `nation`
left join `part` on `r_regionkey` = `p_partkey`
where `n_nationkey` = `r_regionkey`
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
select `n`.`n_name`, `r`.`r_name`
from `nation` as `n`
where `n`.`n_regionkey` = `r`.`r_regionkey`
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
select `n_name`, `r_name`
from `nation`
where `r_regionkey` > `n_nationkey`
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
select `n_name`, `r_name`
from `nation`
where `r_regionkey` <> `n_nationkey`
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
select `n_name`, `department`, `name`, `salary`
from `workers`
where `n_nationkey` = `department`
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
select `p_partkey`, `n_name`, `r_name`
from `part`
inner join `nation` on `n_regionkey` = `p_partkey`
right join `region` on `n_nationkey` = `r_regionkey`
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
select `n_name`
from `nation`
where `n_nationkey` = 17
intersect
select `n_name`
from `nation`
where `n_regionkey` = 1
union
select `n_name`
from `nation`
where `n_regionkey` = 2
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
select `kurtosis`(`c_bigint`), `kurtosis`(`c_double`)
from `datatype`
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
select `n_name`, `p_name`
from `nation`
left join `part` on `n_regionkey` = `p_partkey` and `n_name` = `p_name`
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
select `n_name`, `r_name`
from `nation`
left join `region` on `n_nationkey` = `r_regionkey`
where `r_name` > 'g'
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
select `n_name`
from `nation`
left join `region` on `n_nationkey` = `r_regionkey`
where `r_name` is not null
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
select `n_name`
from `nation`
left join `region` on `n_nationkey` = `r_regionkey`
where `r_name` is null
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
select `n_name`, `r_name`
from `nation`
left join `region` on `n_nationkey` = `r_regionkey`
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
select `p_partkey`, `n_name`, `r_name`
from `nation`
left join `region` on `n_nationkey` = `r_regionkey`
inner join `part` on `n_regionkey` = `p_partkey`
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
select `name`
from `tpch`.`tiny`.`nation`
where `name` like '%an'
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
select `map`(array['ala', 'kot'], array[3, 4])['kot']
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
select max(`c_bigint`), max(`c_double`), max(`c_string`), max(`c_date`), max(`c_timestamp`)
from `datatype`
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
select min(`c1`), max(`c1`)
from `empty`
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
select min(`c_bigint`), min(`c_double`), min(`c_string`), min(`c_date`), min(`c_timestamp`)
from `datatype`
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
select count(`c_string`), max(`c_double`), avg(`c_bigint`)
from `datatype`
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
select count(distinct `n_regionkey`), count(distinct `n_name`), min(distinct `n_nationkey`)
from `nation`
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
with `wnation` as (select `n_nationkey`, `n_regionkey`
from `nation`), `wregion` as (select `r_regionkey`, `r_name`
from `region`) (select `n`.`n_nationkey`, `r`.`r_regionkey`
from `wnation` as `n`
inner join `wregion` as `r` on `n`.`n_regionkey` = `r`.`r_regionkey`
where `r`.`r_name` = 'africa')
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
select `c1` * `c1`
from `empty`
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
select `orderkey`, `suppkey`, `discount`, rank() over (partition by `suppkey`)
from `tpch`.`tiny`.`lineitem`
where `partkey` = 272
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
select `regionkey` as `nationkey`, `nationkey` as `regionkey`, `name`
from `tpch`.`tiny`.`nation`
where `nationkey` < 20
order by `nationkey` desc, `regionkey`
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
select `regionkey` as `nationkey`, `nationkey` as `regionkey`, `name`
from `tpch`.`tiny`.`nation`
where `nationkey` < 20
order by `nationkey` desc, `regionkey`
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
select *
from (select cast(null as bigint)
union all
select 1) as `t`
order by 1
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
select *
from (select cast(null as bigint)
union all
select 1) as `t`
order by 1 nulls first
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
select *
from (select cast(null as bigint)
union all
select 1) as `t`
order by 1 nulls last
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
select *
from (select cast(null as bigint)
union all
select 1) as `t`
order by 1
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
select *
from (select cast(null as bigint)
union all
select 1) as `t`
order by 1 nulls first
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
select *
from (select cast(null as bigint)
union all
select 1) as `t`
order by 1 nulls last
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
select *
from (select cast(null as bigint)
union all
select 1) as `t`
order by 1 desc nulls first
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
select *
from (select cast(null as bigint)
union all
select 1) as `t`
order by 1 desc nulls last
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
select distinct `brand`
from `tpch`.`tiny`.`part`
where `partkey` < 15
order by 1 desc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
select `totalprice` * 1.0625, `custkey`
from `tpch`.`tiny`.`orders`
order by 1
fetch next 20 rows only
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
select `orderdate`, `orderpriority`, `custkey`
from `tpch`.`tiny`.`orders`
order by 1 desc, 2, 3 desc
fetch next 20 rows only
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
select avg(`retailprice`), `mfgr`
from `tpch`.`tiny`.`part`
group by 2
order by count(*)
fetch next 20 rows only
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
select `nationkey`, `name`
from `tpch`.`tiny`.`nation`
order by `regionkey`, `nationkey`
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
select `custkey`, `orderstatus`
from `tpch`.`tiny`.`orders`
order by `totalprice` * 1.0625
fetch next 20 rows only
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
select `regionkey`, `nationkey`
from `tpch`.`tiny`.`nation`
order by 1, 2
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
select `n_nationkey`
from `nation`
where `n_name` < 'india'
order by `n_nationkey`
fetch next 3 rows only
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
select `classify`(`features`(1, 2 + `random`(1)), `model`)
from (select `learn_classifier`(`labels`, `features`) as `model`
from (values row(1, `features`(1, 2))) as `t` (`labels`, `features`)) as `t2`
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
select count(10), max(50), min(90.0)
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
select 1, 1.1, 100 * 5.1, 'a', 'dummy values', true, false
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
select abs(-10.0), `log2`(4), true and false, true or false
Loading

0 comments on commit 097a734

Please sign in to comment.