File tree 1 file changed +19
-8
lines changed
ydb/library/benchmarks/queries/tpch/yql
1 file changed +19
-8
lines changed Original file line number Diff line number Diff line change 4
4
-- TPC TPC-H Parameter Substitution (Version 2.17.2 build 0)
5
5
-- using 1680793381 as a seed to the RNG
6
6
7
+ $p = select p_partkey from {{part}}
8
+ where
9
+ p_brand = ' Brand#35'
10
+ and p_container = ' LG DRUM'
11
+ ;
12
+
7
13
$threshold = (
8
14
select
9
15
0 .2 * avg (l_quantity) as threshold,
10
16
l .l_partkey as l_partkey
11
17
from
12
18
{{lineitem}} as l
13
- join
14
- {{part}} as p
15
- on
19
+ left semi join
20
+ $p as p
21
+ on
16
22
p .p_partkey = l .l_partkey
17
- where
18
- p .p_brand = ' Brand#35'
19
- and p .p_container = ' LG DRUM'
20
23
group by
21
24
l .l_partkey
22
25
);
23
26
27
+ $l = select l .l_partkey as l_partkey, l .l_quantity as l_quantity, l .l_extendedprice as l_extendedprice
28
+ from
29
+ {{lineitem}} as l
30
+ join
31
+ $p as p
32
+ on
33
+ p .p_partkey = l .l_partkey ;
34
+
24
35
select
25
36
sum (l .l_extendedprice ) / 7 .0 as avg_yearly
26
37
from
27
- {{lineitem}} as l
38
+ $l as l
28
39
join
29
40
$threshold as t
30
- on
41
+ on
31
42
t .l_partkey = l .l_partkey
32
43
where
33
44
l .l_quantity < t .threshold ;
You can’t perform that action at this time.
0 commit comments