Skip to content

Commit f0b2003

Browse files
authored
feat: add arithmetic to benches (#29)
# Rationale for this change We need to add new some benches now that we have more features. <!-- Why are you proposing this change? If this is already explained clearly in the linked Jira ticket then this section is not needed. Explaining clearly why changes are proposed helps reviewers understand your changes and offer better suggestions for fixes. --> # What changes are included in this PR? Add a new bench query <!-- There is no need to duplicate the description in the ticket here but it is sometimes worth providing a summary of the individual changes in this PR. --> # Are these changes tested? N/A <!-- We typically require tests for all PRs in order to: 1. Prevent the code from being accidentally broken by subsequent changes 2. Serve as another way to document the expected behavior of the code If tests are not included in your PR, please explain why (for example, are they covered by existing tests)? -->
1 parent cb50067 commit f0b2003

File tree

1 file changed

+16
-0
lines changed
  • crates/proof-of-sql/benches/scaffold

1 file changed

+16
-0
lines changed

crates/proof-of-sql/benches/scaffold/querys.rs

+16
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,21 @@ const MULTI_COLUMN_FILTER_COLUMNS: &[(&str, ColumnType, OptionalRandBound)] = &[
2727
),
2828
("c", ColumnType::VarChar, None),
2929
];
30+
const ARITHMETIC_TITLE: &str = "Arithmetic";
31+
const ARITHMETIC_SQL: &str = "SELECT a + b as r0, a * b - 2 as r1, c FROM table WHERE a >= b";
32+
const ARITHMETIC_COLUMNS: &[(&str, ColumnType, OptionalRandBound)] = &[
33+
(
34+
"a",
35+
ColumnType::BigInt,
36+
Some(|size| (size / 10).max(10) as i64),
37+
),
38+
(
39+
"b",
40+
ColumnType::BigInt,
41+
Some(|size| (size / 10).max(10) as i64),
42+
),
43+
("c", ColumnType::VarChar, None),
44+
];
3045

3146
#[allow(clippy::type_complexity)]
3247
pub const QUERIES: &[(&str, &str, &[(&str, ColumnType, OptionalRandBound)])] = &[
@@ -40,4 +55,5 @@ pub const QUERIES: &[(&str, &str, &[(&str, ColumnType, OptionalRandBound)])] = &
4055
MULTI_COLUMN_FILTER_SQL,
4156
MULTI_COLUMN_FILTER_COLUMNS,
4257
),
58+
(ARITHMETIC_TITLE, ARITHMETIC_SQL, ARITHMETIC_COLUMNS),
4359
];

0 commit comments

Comments
 (0)