diff options
author | Alexey Ozeritskiy <aozeritsky@ydb.tech> | 2024-07-01 19:48:09 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-07-01 20:48:09 +0300 |
commit | 3a2566e37424ae798d669b71cd5c71ffa3da1662 (patch) | |
tree | 96d63825c848a1561c084926ed686f6a6c6fde59 | |
parent | 4ec8b28bf8b0f3b8cfc2d35fa4cdce94606585a4 (diff) | |
download | ydb-3a2566e37424ae798d669b71cd5c71ffa3da1662.tar.gz |
Upscale some results in order to simplify comparison with pg-version (#6130)
4 files changed, 5 insertions, 3 deletions
diff --git a/ydb/library/benchmarks/gen_queries/consts.yql b/ydb/library/benchmarks/gen_queries/consts.yql index 54675e9f1d..b854e22af1 100644 --- a/ydb/library/benchmarks/gen_queries/consts.yql +++ b/ydb/library/benchmarks/gen_queries/consts.yql @@ -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; }; diff --git a/ydb/library/benchmarks/gen_queries/consts_decimal.yql b/ydb/library/benchmarks/gen_queries/consts_decimal.yql index 5b2a1f127c..f2a228eabb 100644 --- a/ydb/library/benchmarks/gen_queries/consts_decimal.yql +++ b/ydb/library/benchmarks/gen_queries/consts_decimal.yql @@ -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)); }; diff --git a/ydb/library/benchmarks/queries/tpcds/yql/q20.sql b/ydb/library/benchmarks/queries/tpcds/yql/q20.sql index a848fe9f5e..d06bc71182 100644 --- a/ydb/library/benchmarks/queries/tpcds/yql/q20.sql +++ b/ydb/library/benchmarks/queries/tpcds/yql/q20.sql @@ -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 diff --git a/ydb/library/benchmarks/queries/tpcds/yql/q36.sql b/ydb/library/benchmarks/queries/tpcds/yql/q36.sql index 514c7fb19f..dc42beaa5c 100644 --- a/ydb/library/benchmarks/queries/tpcds/yql/q36.sql +++ b/ydb/library/benchmarks/queries/tpcds/yql/q36.sql @@ -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 |