Skip to content

Commit aa1cd91

Browse files
authored
ci: fix add leading 0 for query time in benchmark [skip ci] (#10852)
1 parent 7a44344 commit aa1cd91

File tree

4 files changed

+4
-2
lines changed

4 files changed

+4
-2
lines changed

.github/workflows/trusted-benchmark.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ jobs:
319319
number: ${{ needs.metadata.outputs.source_id }}
320320
token: ${{ github.token }}
321321
body: |
322-
![local](https://img.shields.io/static/v1?label=AWS%20EC2&message=c5.4xlarge&color=orange&logo=amazonec2)![cloud](https://img.shields.io/static/v1?label=Databend%20Cloud&message=Medium&color=blue&logo=icloud)![cloud](https://img.shields.io/static/v1?label=Databend%20Cloud&message=Large&color=blue&logo=icloud)
322+
![local](https://img.shields.io/static/v1?label=AWS%20EC2&message=c5.4xlarge&color=orange&logo=amazonec2) ![cloud](https://img.shields.io/static/v1?label=Databend%20Cloud&message=Medium&color=blue&logo=icloud) ![cloud](https://img.shields.io/static/v1?label=Databend%20Cloud&message=Large&color=blue&logo=icloud)
323323
## ClickBench Report
324324
* **hits**: https://repo.databend.rs/benchmark/clickbench/pr/${{ needs.metadata.outputs.source_id }}/${{ needs.metadata.outputs.run_id }}/hits.html
325325
* **tpch**: https://repo.databend.rs/benchmark/clickbench/pr/${{ needs.metadata.outputs.source_id }}/${{ needs.metadata.outputs.run_id }}/tpch.html

benchmark/clickbench/benchmark_cloud.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ function run_query() {
6161
if echo "$query" | bendsql query --format csv --rows-only >/dev/null; then
6262
q_end=$(date +%s.%N)
6363
q_time=$(echo "$q_end - $q_start" | bc -l)
64+
[[ $q_time =~ ^[1-9].*$ ]] || q_time="0$q_time"
6465
echo "Q${query_num}[$seq] succeeded in $q_time seconds"
6566
yq -i ".result[${query_num}] += [${q_time}]" result.json
6667
else

benchmark/clickbench/benchmark_local.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ function run_query() {
100100
if echo "$query" | bendsql query --format csv --rows-only >/dev/null; then
101101
q_end=$(date +%s.%N)
102102
q_time=$(echo "$q_end - $q_start" | bc -l)
103+
[[ $q_time =~ ^[1-9].*$ ]] || q_time="0$q_time"
103104
echo "Q${query_num}[$seq] succeeded in $q_time seconds"
104105
yq -i ".result[${query_num}] += [${q_time}]" result.json
105106
else

benchmark/clickbench/tpch/queries.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@ select 1/0;-- set enable_bushy_join = 1; select c_name, c_custkey, o_orderkey, o
1919
set enable_bushy_join = 1; select sum(l_extendedprice* (1 - l_discount)) as revenue from lineitem, part where ( p_partkey = l_partkey and p_brand = 'Brand#52' and p_container in ( 'SM CASE', 'SM BOX', 'SM PACK', 'SM PKG' ) and l_quantity >= 4 and l_quantity <= 4 + 10 and p_size between 1 and 5 and l_shipmode in ( 'AIR', 'AIR REG' ) and l_shipinstruct = 'DELIVER IN PERSON' ) or ( p_partkey = l_partkey and p_brand = 'Brand#11' and p_container in ( 'MED BAG', 'MED BOX', 'MED PKG', 'MED PACK' ) and l_quantity >= 18 and l_quantity <= 18 + 10 and p_size between 1 and 10 and l_shipmode in ( 'AIR', 'AIR REG' ) and l_shipinstruct = 'DELIVER IN PERSON' ) or ( p_partkey = l_partkey and p_brand = 'Brand#51' and p_container in ( 'LG CASE', 'LG BOX', 'LG PACK', 'LG PKG' ) and l_quantity >= 29 and l_quantity <= 29 + 10 and p_size between 1 and 15 and l_shipmode in ( 'AIR', 'AIR REG' ) and l_shipinstruct = 'DELIVER IN PERSON' ) ;
2020
set enable_bushy_join = 1; select s_name, s_address from supplier, nation where s_suppkey in ( select ps_suppkey from partsupp where ps_partkey in ( select p_partkey from part where p_name like 'forest%' ) and ps_availqty > ( select 0.5 * sum(l_quantity) from lineitem where l_partkey = ps_partkey and l_suppkey = ps_suppkey and l_shipdate >= to_date('1994-01-01') and l_shipdate < add_years(to_date('1994-01-01'), 1) ) ) and s_nationkey = n_nationkey and n_name = 'CANADA' order by s_name;
2121
set enable_bushy_join = 1; select s_name, truncate(count(*),4) as numwait from supplier, lineitem l1, orders, nation where s_suppkey = l1.l_suppkey and o_orderkey = l1.l_orderkey and o_orderstatus = 'F' and l1.l_receiptdate > l1.l_commitdate and exists ( select * from lineitem l2 where l2.l_orderkey = l1.l_orderkey and l2.l_suppkey <> l1.l_suppkey ) and not exists ( select * from lineitem l3 where l3.l_orderkey = l1.l_orderkey and l3.l_suppkey <> l1.l_suppkey and l3.l_receiptdate > l3.l_commitdate ) and s_nationkey = n_nationkey and n_name = 'SAUDI ARABIA' group by s_name order by numwait desc, s_name;
22-
set enable_bushy_join = 1; select cntrycode, count(*) as numcust, sum(c_acctbal) as totacctbal from ( select substring(c_phone from 1 for 2) as cntrycode, c_acctbal from customer where substring(c_phone from 1 for 2) in ('13', '31', '23', '29', '30', '18', '17') and c_acctbal > ( select avg(c_acctbal) from customer where c_acctbal > 0.00 and substring(c_phone from 1 for 2) in ('13', '31', '23', '29', '30', '18', '17') ) and not exists ( select * from orders where o_custkey = c_custkey ) ) as custsale group by cntrycode order by cntrycode;
22+
select 1/0;-- set enable_bushy_join = 1; select cntrycode, count(*) as numcust, sum(c_acctbal) as totacctbal from ( select substring(c_phone from 1 for 2) as cntrycode, c_acctbal from customer where substring(c_phone from 1 for 2) in ('13', '31', '23', '29', '30', '18', '17') and c_acctbal > ( select avg(c_acctbal) from customer where c_acctbal > 0.00 and substring(c_phone from 1 for 2) in ('13', '31', '23', '29', '30', '18', '17') ) and not exists ( select * from orders where o_custkey = c_custkey ) ) as custsale group by cntrycode order by cntrycode;

0 commit comments

Comments
 (0)