Skip to content

Commit f1465af

Browse files
connortsui20claude
andauthored
Consolidate benchmark SQL queries into vortex-bench/sqldirectory (#8684)
## Rationale for this change This PR reorganizes benchmark SQL queries by consolidating them into a centralized `vortex-bench/sql/` directory structure. Previously, queries were either hardcoded as string arrays in Rust source files or scattered across different locations. This change improves maintainability by: 1. **Centralizing query definitions**: All SQL queries are now in dedicated `.sql` files, making them easier to review, edit, and version control 2. **Improving query discoverability**: Queries are now organized by benchmark name in a consistent directory structure 3. **Enabling better documentation**: SQL files can include comments explaining each query's purpose 4. **Reducing code duplication**: Eliminates the need to maintain query strings in both Rust code and documentation ## What changes are included in this PR? ### New SQL files created: - `vortex-bench/sql/fineweb.sql` - 9 string-focused queries (Q0-Q8) for the FineWeb dataset - `vortex-bench/sql/gharchive.sql` - 5 queries (Q0-Q4) for GitHub Archive nested event data ### SQL files reorganized: - Moved existing query files to `vortex-bench/sql/` subdirectories: - `appian/q{1..8}.sql` → `sql/appian/q{1..8}.sql` - `tpch/q*.sql` → `sql/tpch/q*.sql` - `tpcds/{01..99}.sql` → `sql/tpcds/{01..99}.sql` - `clickbench_queries.sql` → `sql/clickbench_queries.sql` - `polarsignals.sql` → `sql/polarsignals.sql` - `spatialbench.sql` → `sql/spatialbench.sql` - `statpopgen.sql` → `sql/statpopgen.sql` ### Rust source changes: - **`vortex-bench/src/fineweb/mod.rs`**: Replaced hardcoded `QUERIES` array with file-based loading from `sql/fineweb.sql` - **`vortex-bench/src/realnest/gharchive.rs`**: Replaced hardcoded `QUERIES` array with file-based loading from `sql/gharchive.sql` - **`vortex-bench/src/appian/mod.rs`**: Updated documentation to reflect new `sql/appian/` path - **`vortex-bench/src/clickbench/benchmark.rs`**: Updated default query file path to `sql/clickbench_queries.sql` - **`vortex-bench/src/tpch/mod.rs`**, **`vortex-bench/src/tpcds/mod.rs`**: Updated to use new `sql/` directory structure - **Other benchmarks** (`polarsignals`, `spatialbench`, `statpopgen`): Updated query file paths to use new `sql/` directory All query loading now uses a consistent pattern: read the SQL file, split on semicolons, trim whitespace, filter empty statements, and enumerate for query numbering. ## What APIs are changed? Are there any user-facing changes? No public APIs are changed. This is an internal reorganization of benchmark infrastructure. The benchmark behavior remains identical—queries are loaded and executed in the same order, just from external files instead of hardcoded strings. Users running benchmarks will not notice any difference in functionality or output. https://claude.ai/code/session_015ANEJi5xgm5tpb16ezGGzd Signed-off-by: Claude <[email protected]> Co-authored-by: Claude <[email protected]>
1 parent 3e32163 commit f1465af

144 files changed

Lines changed: 92 additions & 33 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎vortex-bench/sql/fineweb.sql‎

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
-- Some basic string-focused queries against the HuggingFace FineWeb dataset, numbered from
2+
-- Q0 in file order. The harness splits the file on semicolons, so a comment must never
3+
-- contain one.
4+
5+
-- Q0: simple summary.
6+
SELECT count(DISTINCT dump) FROM fineweb;
7+
8+
-- Q1: selective string equality filter.
9+
SELECT * FROM fineweb WHERE dump = 'CC-MAIN-2016-30';
10+
11+
-- Q2: LIKE with prefix filter.
12+
SELECT * FROM fineweb WHERE date LIKE '2020-10-%';
13+
14+
-- Q3: LIKE with simple containment filter.
15+
SELECT * FROM fineweb WHERE url LIKE '%google%' AND text LIKE '%Google%';
16+
17+
-- Q4: LIKE with larger containment filter.
18+
SELECT * FROM fineweb WHERE url LIKE '%.google.%' OR text LIKE '% Google %';
19+
20+
-- Q5: LIKE with rare containment filter.
21+
SELECT * FROM fineweb WHERE text LIKE '% vortex %';
22+
23+
-- Q6: more LIKE filters.
24+
SELECT * FROM fineweb WHERE url LIKE '%espn%' AND language = 'en' AND language_score > 0.92;
25+
26+
-- Q7: more LIKE filters.
27+
SELECT * FROM fineweb WHERE url LIKE '%espn%' OR url LIKE '%www.espn.go.com%' OR url LIKE '%espn.go.com%';
28+
29+
-- Q8: no results, stats cannot prune but tokenized bloom filters could.
30+
SELECT * FROM fineweb WHERE file_path LIKE '%/CC-MAIN-2014-%';

0 commit comments

Comments
 (0)