Skip to content

Commit

Permalink
Upscale some results in order to simplify comparison with pg-version (y…
Browse files Browse the repository at this point in the history
  • Loading branch information
resetius authored Jul 1, 2024
1 parent 4ec8b28 commit 3a2566e
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions ydb/library/benchmarks/gen_queries/consts.yql
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@ $z0_9_35 = 0.9;
$z1_1_35 = 1.1;

$round = ($x, $y) -> { return Math::Round($x, $y); };
$upscale = ($x) -> { return $x; };
1 change: 1 addition & 0 deletions ydb/library/benchmarks/gen_queries/consts_decimal.yql
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@ $z0_05_35 = cast("0.05" as decimal(35,2));
$z0_9_35 = cast("0.9" as decimal(35,2));
$z1_1_35 = cast("1.1" as decimal(35,2));
$round = ($x,$y) -> {return $x;};
$upscale = ($x) -> { return cast($x as decimal(35,9)); };
2 changes: 1 addition & 1 deletion ydb/library/benchmarks/queries/tpcds/yql/q20.sql
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ select item.i_item_id
,item.i_class
,item.i_current_price
,sum(cs_ext_sales_price) as itemrevenue
,sum(cs_ext_sales_price)*100/sum(sum(cs_ext_sales_price)) over
,$upscale(sum(cs_ext_sales_price)*100)/sum($upscale(sum(cs_ext_sales_price))) over
(partition by item.i_class) as revenueratio
from {{catalog_sales}} as catalog_sales
cross join {{item}} as item
Expand Down
4 changes: 2 additions & 2 deletions ydb/library/benchmarks/queries/tpcds/yql/q36.sql
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
-- NB: Subquerys
-- start query 1 in stream 0 using template query36.tpl and seed 1544728811
select
sum(ss_net_profit)/sum(ss_ext_sales_price) as gross_margin
$upscale(sum(ss_net_profit))/$upscale(sum(ss_ext_sales_price)) as gross_margin
,item.i_category
,item.i_class
,grouping(item.i_category)+grouping(item.i_class) as lochierarchy
,rank() over (
partition by grouping(item.i_category)+grouping(item.i_class),
case when grouping(item.i_class) = 0 then item.i_category else null end
order by sum(ss_net_profit)/sum(ss_ext_sales_price) asc) as rank_within_parent
order by $upscale(sum(ss_net_profit))/$upscale(sum(ss_ext_sales_price)) asc) as rank_within_parent
from
{{store_sales}} as store_sales
cross join {{date_dim}} d1
Expand Down

0 comments on commit 3a2566e

Please sign in to comment.