aboutsummaryrefslogtreecommitdiffstats
path: root/yql/essentials/tests/sql/suites/pg/aggregate_factory.sql
blob: 6fbe0119bdd977e8ddb5150e219c646db767addc (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
select 
Pg::string_agg(x,','p)
from (values ('a'p),('b'p),('c'p)) as a(x);

select 
Pg::string_agg(x,','p) over (order by x),
from (values ('a'p),('b'p),('c'p)) as a(x);

$agg_string_agg = AggregationFactory("Pg::string_agg");

select 
AggregateBy((x,','p),$agg_string_agg)
from (values ('a'p),('b'p),('c'p)) as a(x);

select 
AggregateBy((x,','p),$agg_string_agg) over (order by x),
from (values ('a'p),('b'p),('c'p)) as a(x);

$agg_max = AggregationFactory("Pg::max");

select 
AggregateBy(x,$agg_max)
from (values ('a'p),('b'p),('c'p)) as a(x);

select 
AggregateBy(x,$agg_max) over (order by x),
from (values ('a'p),('b'p),('c'p)) as a(x);