Skip to content

Commit 22bc9b8

Browse files
authored
Fix tpcds q44 (#14744)
1 parent 24d8aaa commit 22bc9b8

File tree

6 files changed

+26
-4
lines changed

6 files changed

+26
-4
lines changed

ydb/library/benchmarks/queries/tpcds/pg/q44.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ from(select *
3030
where asceding.rnk = descending.rnk
3131
and i1.i_item_sk=asceding.item_sk
3232
and i2.i_item_sk=descending.item_sk
33-
order by asceding.rnk
33+
order by asceding.rnk, best_performing, worst_performing
3434
limit 100;
3535

3636
-- end query 1 in stream 0 using template ../query_templates/query44.tpl

ydb/library/benchmarks/queries/tpcds/yql/q44.sql

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ $avg_net_profit = (select avg(ss_net_profit) rank_col
1111
select asceding.rnk, i1.i_product_name best_performing, i2.i_product_name worst_performing
1212
from(select *
1313
from (select item_sk,rank() over (order by rank_col asc) rnk
14-
from (select ss_item_sk item_sk,$round(avg(ss_net_profit), -2) rank_col
14+
from (select ss_item_sk item_sk, $round(avg(ss_net_profit), -2) rank_col
1515
from {{store_sales}} ss1
1616
where ss_store_sk = 4
1717
group by ss_item_sk
@@ -20,7 +20,7 @@ from(select *
2020
cross join
2121
(select *
2222
from (select item_sk,rank() over (order by rank_col desc) rnk
23-
from (select ss_item_sk item_sk,$round(avg(ss_net_profit), -2) rank_col
23+
from (select ss_item_sk item_sk, $round(avg(ss_net_profit), -2) rank_col
2424
from {{store_sales}} ss1
2525
where ss_store_sk = 4
2626
group by ss_item_sk
@@ -32,7 +32,7 @@ from(select *
3232
where asceding.rnk = descending.rnk
3333
and i1.i_item_sk=asceding.item_sk
3434
and i2.i_item_sk=descending.item_sk
35-
order by asceding.rnk
35+
order by asceding.rnk, best_performing, worst_performing
3636
limit 100;
3737

3838
-- end query 1 in stream 0 using template query44.tpl
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
asceding.rnk,best_performing,worst_performing
2+
1,"ablen stationesepri","pricallyantiation"
3+
1,"barableoughtcallyought","pricallyantiation"
4+
3,"ablecallyeingbarn stought","esen stbarablen st"
5+
3,"oughtationationcallyoughtought","esen stbarablen st"
6+
5,"n stantiationanti","barn steingableeseought"
7+
6,"ationantibarantieingought","barationantieingation"
8+
6,"eingn stationn stable","barationantieingation"
9+
8,"antiprieingantically","eseoughtpriationpri"
10+
8,"ationantioughteseanti","eseoughtpriationpri"
11+
8,"oughtn stationeseought","eseoughtpriationpri"
Binary file not shown.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
asceding.rnk,best_performing,worst_performing
2+
1,"prieingantibarese","ableationcallyese"
3+
2,"ationcallyn steseanti","eingcallyn stantianti"
4+
3,"oughtantiesecallyn st","priableeingbaranti"
5+
3,"oughtoughtableoughtpri","priableeingbaranti"
6+
5,"antibarationbarought","oughtbarn stcallyese"
7+
6,"ationn stablecallyese","callyablen stantieing"
8+
6,"n stationoughtcallyation","callyablen stantieing"
9+
8,"ableationationcallycally","ablecallypriantieing"
10+
8,"oughtn stbaroughtn st","ablecallypriantieing"
11+
10,"oughtcallyprioughteing","eingableoughtoughtese"
Binary file not shown.

0 commit comments

Comments
 (0)