Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
cf6e5b0
Record each benchmark Parquet file's codec in its file size
lwwmanning Nov 20, 2026
0765109
Record Snappy Parquet sizes in compress-bench
lwwmanning Nov 20, 2026
f81ace6
Record compact Vortex sizes in compress-bench
lwwmanning Nov 20, 2026
2b22043
Record Arrow IPC, Lance, and Snappy Parquet sizes for TPC-DS SF1
lwwmanning Nov 20, 2026
f6b1de0
Query Snappy Parquet and Lance on TPC-DS SF1
lwwmanning Nov 20, 2026
8e897c6
Add the license header to parquet_copies.rs
lwwmanning Nov 21, 2026
e09b400
Write zstd Parquet for statpopgen, SpatialBench's zone table, and the…
lwwmanning Nov 21, 2026
43d89ce
Write parquet-snappy with DuckDB and name Parquet sizes by directory
lwwmanning Nov 21, 2026
a84b998
Match the cast's new overflow message in a CUDA FFI test
lwwmanning Nov 21, 2026
8e0cb97
Install the DuckDB 2.0.0 CLI on benchmark runners
lwwmanning Nov 21, 2026
147ab29
Install the DuckDB 2.0.1 CLI on benchmark runners
lwwmanning Nov 21, 2026
756a4d2
Keep untimed work out of timed benchmark runs, and recompress tagged …
lwwmanning Nov 21, 2026
6433890
Move compress-bench's size-only records into their own function
lwwmanning Nov 21, 2026
48bcff4
Query Snappy Parquet in TPC-H SF10 on NVMe and S3 on develop
lwwmanning Nov 21, 2026
e0e95b1
TEMPORARY: run TPC-H SF10 Snappy targets in the pr preset
lwwmanning Nov 21, 2026
c9ccf06
Count the Parquet footer and rewrite stale cached Parquet
lwwmanning Nov 21, 2026
8ca376c
TEMPORARY: query DuckDB's Parquet with zstd in TPC-H SF10 on this PR
lwwmanning Nov 21, 2026
6f5e01b
TEMPORARY: query DuckDB's zstd Parquet in 1,048,576-row groups on thi…
lwwmanning Nov 21, 2026
283ad8a
Revert "TEMPORARY: query DuckDB's zstd Parquet in 1,048,576-row group…
lwwmanning Nov 21, 2026
ffbfc5b
Revert "TEMPORARY: query DuckDB's Parquet with zstd in TPC-H SF10 on …
lwwmanning Nov 21, 2026
0bcc141
Revert "TEMPORARY: run TPC-H SF10 Snappy targets in the pr preset"
lwwmanning Nov 21, 2026
754d9c6
Revert "Query Snappy Parquet in TPC-H SF10 on NVMe and S3 on develop"
lwwmanning Nov 21, 2026
3d619c0
Write Snappy Parquet only for sizes, and size row groups by storage
lwwmanning Nov 21, 2026
78551cf
Record Snappy Parquet sizes only in compress-bench
lwwmanning Nov 21, 2026
50a3ed4
Generate Parquet again when its row groups change
lwwmanning Nov 21, 2026
cfc00b3
Remove converted formats with Parquet whose row groups changed
lwwmanning Nov 21, 2026
d7a62f4
Say where the l_comment dataset's row-group size comes from
lwwmanning Nov 21, 2026
6f19d43
Put is_zstd's doc comment back on is_zstd
lwwmanning Nov 21, 2026
76d5500
Read random access Parquet with a page index, the taxi data included
lwwmanning Nov 21, 2026
89bd5ca
Say which suites the row-group rule covers
lwwmanning Nov 21, 2026
9f12a81
Write JOB, Polar Signals, and SpatialBench Parquet with the shared co…
lwwmanning Nov 21, 2026
34797dd
Generate SpatialBench Parquet again when its row groups change
lwwmanning Nov 21, 2026
f6d749e
Write SpatialBench zone files in local row groups
lwwmanning Nov 21, 2026
8f04eb8
Write all benchmark Parquet with one set of writer settings
lwwmanning Nov 21, 2026
ae74dc4
Record the Parquet layout version in each generated file
lwwmanning Nov 21, 2026
6872cb4
Generate cached benchmark Parquet again in a new layout
lwwmanning Nov 21, 2026
7c885be
Keep the layout version in concatenated TPC-H Parquet
lwwmanning Nov 21, 2026
644fbb9
Pass S3 row groups to the benchmark run, not only to data generation
lwwmanning Nov 21, 2026
c7814a2
Write parquet-snappy with the same settings as parquet
lwwmanning Nov 21, 2026
aff33cb
Read the page index with the current parquet-rs API in the Snappy test
lwwmanning Nov 21, 2026
2addb48
Record Snappy Parquet's size on TPC-DS at SF1
lwwmanning Nov 21, 2026
911d6aa
Write the struct-list compression datasets with the shared Parquet co…
lwwmanning Nov 21, 2026
9997597
Read view types as plain types for Arrow IPC and compress-bench
lwwmanning Nov 21, 2026
3b15172
Measure the uncompressed size in the representation compress-bench loads
lwwmanning Nov 21, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions .github/actions/setup-duckdb/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@ name: "Setup DuckDB"
description: "Download the DuckDB CLI and put it on PATH"
inputs:
duckdb_version:
# Keep this on the DuckDB minor version that `vortex-duckdb/build.rs` links (2.0), so the CLI
# that writes the `duckdb` database matches the DuckDB the queries run on.
description: "Version of the DuckDB CLI"
default: "1.5.5"
default: "2.0.1"
runs:
using: "composite"
steps:
Expand All @@ -19,8 +21,10 @@ runs:
;;
esac

# Since 2.0, the release ships the CLI as a tarball that holds the `duckdb` binary.
wget -qO- \
"https://github.com/duckdb/duckdb/releases/download/v${{ inputs.duckdb_version }}/duckdb_cli-linux-${duckdb_arch}.zip" \
| funzip > duckdb
"https://github.com/duckdb/duckdb/releases/download/v${{ inputs.duckdb_version }}/duckdb-cli-linux-${duckdb_arch}.tar.gz" \
| tar -xz duckdb
chmod +x duckdb
./duckdb --version
echo "$PWD" >> "$GITHUB_PATH"
1 change: 1 addition & 0 deletions .github/workflows/develop-bench.yml
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,7 @@ jobs:
hashFiles(
'vortex-bench/src/datasets/**',
'vortex-bench/src/random_access/**',
'vortex-bench/src/utils/parquet.rs',
'scripts/litdata-random-access.py',
'benchmarks/random-access-bench/src/litdata.rs') }}

Expand Down
1 change: 1 addition & 0 deletions .github/workflows/pr-bench-runner.yml
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,7 @@ jobs:
hashFiles(
'vortex-bench/src/datasets/**',
'vortex-bench/src/random_access/**',
'vortex-bench/src/utils/parquet.rs',
'scripts/litdata-random-access.py',
'benchmarks/random-access-bench/src/litdata.rs') }}

Expand Down
15 changes: 15 additions & 0 deletions .github/workflows/sql-bench-matrix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,7 @@ jobs:
uv run --project bench-orchestrator vx-bench prepare-data "${{ matrix.subcommand }}" \
--formats-json '${{ toJSON(matrix.data_formats) }}' \
${S3_CACHE:+--s3-cache "$S3_CACHE"} \
${{ matrix.row_group_rows && format('--opt row-group-rows={0}', matrix.row_group_rows) || '' }} \
Comment thread
lwwmanning marked this conversation as resolved.
Resolved
${{ matrix.scale_factor && format('--opt scale-factor={0}', matrix.scale_factor) || '' }}

# setup-benchmark.sh pins every running process to the housekeeping CPUs, so it waits for
Expand Down Expand Up @@ -255,6 +256,8 @@ jobs:
- name: Setup benchmark environment
run: sudo bash scripts/setup-benchmark.sh

# The run steps pass the same row groups as "Generate data". A fork PR runs an S3 entry
# here, on local data, and a benchmark that expects other row groups removes that data.
- name: Run ${{ matrix.name }} benchmark
if: matrix.remote_key == null || github.event.pull_request.head.repo.fork == true
shell: bash
Expand All @@ -271,6 +274,7 @@ jobs:
--ingest-jsonl results.ingest.jsonl \
--no-build \
${{ matrix.iterations && format('--iterations {0}', matrix.iterations) || '' }} \
${{ matrix.row_group_rows && format('--opt row-group-rows={0}', matrix.row_group_rows) || '' }} \
${{ matrix.scale_factor && format('--opt scale-factor={0}', matrix.scale_factor) || '' }}

- name: Run ${{ matrix.name }} benchmark (remote)
Expand All @@ -291,9 +295,20 @@ jobs:
--ingest-jsonl results.ingest.jsonl \
--no-build \
${{ matrix.iterations && format('--iterations {0}', matrix.iterations) || '' }} \
${{ matrix.row_group_rows && format('--opt row-group-rows={0}', matrix.row_group_rows) || '' }} \
--opt remote-data-dir="$REMOTE_STORAGE" \
${{ matrix.scale_factor && format('--opt scale-factor={0}', matrix.scale_factor) || '' }}

# Formats that no query reads, written after the queries so they cannot affect them, only
# for the file sizes that "Capture file sizes" records.
- name: Write size-only formats
if: matrix.remote_key == null && matrix.records_data && join(matrix.size_formats, ',') != ''
shell: bash
run: |
uv run --project bench-orchestrator vx-bench write-size-formats "${{ matrix.subcommand }}" \
--formats-json '${{ toJSON(matrix.size_formats) }}' \
${{ matrix.scale_factor && format('--opt scale-factor={0}', matrix.scale_factor) || '' }}

# The `file_size` records join the run's ingest records: develop runs store them in the
# benchmarks database (the `file_sizes` table), and PR runs fetch them back as the baseline.
- parallel:
Expand Down
12 changes: 11 additions & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,17 @@ These CI checks are the ones most often missed when adding files rather than edi
- DuckDB: `(FORMAT parquet, COMPRESSION zstd, COMPRESSION_LEVEL 3)`
- tpchgen-cli: `parquet --compression='ZSTD(3)'`
- Benchmarks that deliberately compare Parquet codecs, such as the GPU compress benchmark's
`--codec`, are exempt.
`--codec` and the Snappy Parquet whose size `compress-bench` and TPC-DS at SF1 record, are
exempt.
- Every parquet-rs writer of benchmark data uses `parquet_writer_properties()` in
`vortex-bench/src/utils/parquet.rs`: zstd level 3, 64 KiB dictionaries, a page index, and
parquet-rs's default pages of at most 1 MiB and about 20,000 rows. Only the row-group size
Comment thread
lwwmanning marked this conversation as resolved.
Resolved
differs. SQL data has row groups of 122,880 rows (`LOCAL_ROW_GROUP_ROWS`, DuckDB's default) on
local disk and 1,048,576 rows (`S3_ROW_GROUP_ROWS`, parquet-rs's default) on S3: the CI matrix
passes `--opt row-group-rows=1048576` to `data-gen` for S3 entries. Random access uses the S3
size on local disk too, because its S3 job reads the files that its local job prepares. When a
setting changes, raise `LAYOUT_VERSION` so that local data is generated again. The suites that
DuckDB's `COPY` writes get DuckDB's 122,880-row groups by default.

## Common Mistakes

Expand Down
12 changes: 10 additions & 2 deletions bench-orchestrator/bench_orchestrator/ci_matrix/catalog.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

from dataclasses import replace

from ..config import Benchmark, BenchmarkTarget, Engine, Format, Integration, ScanEngine
from ..config import Benchmark, BenchmarkTarget, Engine, Format, Integration, ScanEngine, SizeFormat
from .model import BenchmarkCase, Catalog, Coverage, ScanCoverage, Storage
from .render import merge_coverage
from .targets import TargetSet, df, duck
Expand Down Expand Up @@ -91,6 +91,14 @@ def with_all_scans(coverage: Coverage) -> Coverage:
data_formats=(Format.PARQUET, Format.VORTEX, Format.VORTEX_COMPACT, Format.DUCKDB),
)
STANDARD_WITH_DUCKDB = Coverage(STANDARD_WITH_DUCKDB_TARGETS)
# TPC-DS SF1 is the SQL data that bench.vortex.dev's File Sizes summary ranks, so develop also
# records the sizes of Lance, Arrow IPC, and Snappy Parquet there, the formats compress-bench also
# records. It queries Lance on DataFusion, and writes Arrow IPC and Snappy Parquet only for their
# sizes. All three are small and fast at SF1.
STANDARD_WITH_DUCKDB_AND_SIZE_FORMATS = Coverage(
STANDARD_WITH_DUCKDB_TARGETS | df(Format.LANCE),
size_formats=(SizeFormat.ARROW_IPC, SizeFormat.PARQUET_SNAPPY),
)
DATAFUSION_VORTEX = Coverage(DATAFUSION_VORTEX_TARGETS)
COMPACT = Coverage(COMPACT_TARGETS)
JOB_DUCKDB = Coverage(duck(Format.PARQUET, Format.VORTEX, Format.DUCKDB))
Expand Down Expand Up @@ -252,7 +260,7 @@ def _tpcds_sf100_job(target: BenchmarkTarget) -> str:
"pr": DEFAULT,
"pr-compact": COMPACT,
"pr-full": STANDARD_WITH_DUCKDB,
"develop": STANDARD_WITH_DUCKDB,
"develop": STANDARD_WITH_DUCKDB_AND_SIZE_FORMATS,
},
),
BenchmarkCase(
Expand Down
4 changes: 3 additions & 1 deletion bench-orchestrator/bench_orchestrator/ci_matrix/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from dataclasses import dataclass, replace
from enum import Enum

from ..config import SCAN_COMBINATIONS, Benchmark, BenchmarkTarget, Format
from ..config import SCAN_COMBINATIONS, Benchmark, BenchmarkTarget, Format, SizeFormat
from .targets import TargetSet


Expand Down Expand Up @@ -36,6 +36,8 @@ class Coverage:
targets: TargetSet
data_formats: tuple[Format, ...] | None = None
scans: ScanCoverage = ScanCoverage.DEFAULT
# Formats written after the queries only to record their file sizes. No query reads them.
size_formats: tuple[SizeFormat, ...] = ()

def resolved_targets(self, benchmark: Benchmark) -> TargetSet:
"""Return the targets this coverage runs in `benchmark`, with every scan engine named.
Expand Down
21 changes: 18 additions & 3 deletions bench-orchestrator/bench_orchestrator/ci_matrix/render.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@

"""Render declarative benchmark coverage as GitHub Actions matrices."""

from ..config import Benchmark, BenchmarkTarget, Engine, Format, Integration, ScanEngine
from .model import BenchmarkCase, Catalog, Coverage, ScanCoverage
from ..config import Benchmark, BenchmarkTarget, Engine, Format, Integration, ScanEngine, SizeFormat
from .model import BenchmarkCase, Catalog, Coverage, ScanCoverage, Storage
from .targets import TargetSet
from .validate import validate_catalog

_NOT_GENERATED = frozenset({Format.LANCE})
# vortex-bench's `S3_ROW_GROUP_ROWS`: parquet-rs's default.
S3_ROW_GROUP_ROWS = 1024 * 1024
_FORMAT_ORDER = (
Format.PARQUET,
Format.VORTEX,
Expand All @@ -31,12 +33,19 @@ def merge_coverage(benchmark: Benchmark, coverages: list[Coverage]) -> Coverage:
"""Union several coverages of `benchmark`: every resolved target and every generated format."""
targets = TargetSet()
formats: set[Format] = set()
size_formats: set[SizeFormat] = set()
for coverage in coverages:
resolved = coverage.resolved_targets(benchmark)
targets = targets | resolved
formats.update(_data_formats(coverage, resolved))
size_formats.update(coverage.size_formats)
scans = ScanCoverage.ALL if any(c.scans is ScanCoverage.ALL for c in coverages) else ScanCoverage.DEFAULT
return Coverage(targets, data_formats=tuple(fmt for fmt in _FORMAT_ORDER if fmt in formats), scans=scans)
return Coverage(
targets,
data_formats=tuple(fmt for fmt in _FORMAT_ORDER if fmt in formats),
scans=scans,
size_formats=tuple(fmt for fmt in SizeFormat if fmt in size_formats),
)


ScanGroup = tuple[Engine, Integration, ScanEngine]
Expand Down Expand Up @@ -95,6 +104,8 @@ def _matrix_entry(
# File sizes and trees describe the data, which every entry of a case generates alike, so
# only the default entry records them.
"records_data": group is None,
# Formats the default entry writes after its queries, only for their file sizes.
"size_formats": [fmt.value for fmt in coverage.size_formats] if group is None else [],
}
if benchmark.scale_factor is not None:
entry["scale_factor"] = str(benchmark.scale_factor)
Expand All @@ -105,6 +116,10 @@ def _matrix_entry(
if benchmark.remote_key is not None:
# A distinct key per entry: each S3 entry clears and re-uploads its own copy of the data.
entry["remote_key"] = benchmark.remote_key + suffix
if benchmark.storage is Storage.S3:
# Generated Parquet that queries read from S3 has larger row groups than the default, so
# it needs fewer requests to object storage. Suites that query published files ignore it.
entry["row_group_rows"] = str(S3_ROW_GROUP_ROWS)
Comment thread
lwwmanning marked this conversation as resolved.
Resolved
return entry


Expand Down
12 changes: 12 additions & 0 deletions bench-orchestrator/bench_orchestrator/ci_matrix/validate.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,18 @@ def _validate_coverage(benchmark: BenchmarkCase, preset: str, coverage: Coverage
if Format.LANCE in coverage.data_formats:
raise ValueError(f"Benchmark {benchmark.id!r} cannot generate Lance data in preset {preset!r}")

if len(coverage.size_formats) != len(set(coverage.size_formats)):
raise ValueError(f"Benchmark {benchmark.id!r} repeats a size-only format in preset {preset!r}")
if coverage.size_formats and benchmark.storage is not Storage.NVME:
raise ValueError(f"Benchmark {benchmark.id!r} records no file sizes, so it cannot write size-only formats")
read_formats = {target.format.value for target in coverage.targets}
for size_format in coverage.size_formats:
if size_format.value in read_formats:
raise ValueError(
f"Benchmark {benchmark.id!r} reads {size_format.value!r} in preset {preset!r}, "
"so it needs no size-only write"
)


def validate_catalog(catalog: Catalog) -> None:
"""Validate catalog references and per-preset benchmark invariants."""
Expand Down
55 changes: 55 additions & 0 deletions bench-orchestrator/bench_orchestrator/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,10 @@
Engine,
Format,
RunConfig,
SizeFormat,
group_targets_by_backend,
parse_formats_json,
parse_size_formats_json,
parse_targets_json,
resolve_axis_targets,
)
Expand Down Expand Up @@ -280,6 +282,57 @@ def prepare_data(
raise typer.Exit(1) from exc


@app.command("write-size-formats")
def write_size_formats(
benchmark: Annotated[Benchmark, typer.Argument(help="Benchmark suite whose data to write")],
formats_json: Annotated[
str,
typer.Option("--formats-json", help="Size-only formats to write, as a JSON array"),
],
verbose: Annotated[bool, typer.Option("--verbose", "-v", help="Log underlying commands")] = False,
options: Annotated[list[str] | None, typer.Option("--opt", help="Benchmark-specific options")] = None,
) -> None:
"""Write formats that no query reads, only to record their file sizes.

Run it after `prepare-data`: each format is written from the benchmark's base Parquet files.
"""
try:
formats = parse_size_formats_json(formats_json)
bench_opts = parse_options(options)
except ValueError as exc:
console.print(f"[red]{exc}[/red]")
raise typer.Exit(1) from exc

opt_args = [arg for key, value in bench_opts.items() for arg in ("--opt", f"{key}={value}")]
builder = BenchmarkBuilder(verbose=verbose)
commands = []
data_gen_formats = [fmt.value for fmt in formats if fmt is not SizeFormat.LANCE]
if data_gen_formats:
commands.append(
[
str(builder.get_data_generator_path()),
benchmark.value,
"--size-formats",
",".join(data_gen_formats),
*opt_args,
]
)
if SizeFormat.LANCE in formats:
commands.append([str(builder.get_binary_path(Engine.LANCE)), benchmark.value, "--data-only", *opt_args])

for cmd in commands:
if not Path(cmd[0]).exists():
console.print(f"[red]Binary not found: {cmd[0]}[/red]")
raise typer.Exit(1)
if verbose:
console.print(f"[dim]$ {' '.join(cmd)}[/dim]")
try:
subprocess.run(cmd, check=True)
except subprocess.CalledProcessError as exc:
console.print(f"[red]Writing size-only formats failed: {exc}[/red]")
raise typer.Exit(1) from exc


@app.command("matrix")
def matrix(
preset: Annotated[
Expand Down Expand Up @@ -429,6 +482,8 @@ def stream(line: str, target: BenchmarkTarget = target) -> None:
write_result_line(line, ctx.write_raw_json, compatibility_file)

try:
# Before the first cache drop, so the first query reads cold files.
executor.write_data(benchmark, bench_opts)
query_ids = executor.list_queries(benchmark, query_list, exclude_list)
for i, query_id in enumerate(query_ids, start=1):
query_results.clear()
Expand Down
27 changes: 27 additions & 0 deletions bench-orchestrator/bench_orchestrator/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,19 @@ class ScanEngine(Enum):
V2 = "v2"


class SizeFormat(Enum):
"""A format a benchmark writes only to record its file sizes. No query reads it.

`vx-bench write-size-formats` writes Arrow IPC and Snappy Parquet with `data-gen --size-formats`,
and Lance with `lance-bench --data-only`.
"""

ARROW_IPC = "arrow-ipc"
LANCE = "lance"
# The base Parquet with Snappy in place of zstd level 3, and every other writer setting the same.
PARQUET_SNAPPY = "parquet-snappy"


class Benchmark(Enum):
"""Available benchmark suites."""

Expand Down Expand Up @@ -334,6 +347,20 @@ def parse_targets_json(value: str) -> list[BenchmarkTarget]:
return _unique_preserve_order(BenchmarkTarget.from_dict(item) for item in raw_targets)


def parse_size_formats_json(value: str) -> list[SizeFormat]:
"""Parse a JSON array of size-only format names."""
try:
raw_formats = json.loads(value)
except json.JSONDecodeError as exc:
raise ValueError("Size formats JSON must be a valid JSON array") from exc
if not isinstance(raw_formats, list) or not all(isinstance(item, str) for item in raw_formats):
raise ValueError("Size formats JSON must be an array of strings")
try:
return _unique_preserve_order(SizeFormat(item) for item in raw_formats)
except ValueError as exc:
raise ValueError(f"Invalid size format in {raw_formats}") from exc


def parse_formats_json(value: str) -> list[Format]:
"""Parse a JSON array of format names."""
try:
Expand Down
2 changes: 1 addition & 1 deletion bench-orchestrator/bench_orchestrator/data_cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def cached_dataset(benchmark: Benchmark, options: dict[str, str], workspace_root
f"statpopgen-{n_rows}",
data_dir / "statpopgen" / str(n_rows) / "parquet",
workspace_root,
["vortex-bench/src/statpopgen"],
["vortex-bench/src/statpopgen", "vortex-bench/src/utils/parquet.rs"],
)
if benchmark is Benchmark.CLICKBENCH_SORTED:
return _dataset(
Expand Down
22 changes: 22 additions & 0 deletions bench-orchestrator/bench_orchestrator/runner/executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,28 @@ def _check_integration(self, integration: Integration) -> None:
if self.backend is not Engine.LANCE and (self.backend, integration) not in INTEGRATION_ARGS:
raise ValueError(f"{self.backend.value} cannot run the {integration.value} integration")

def write_data(self, benchmark: Benchmark, options: dict[str, str] | None = None) -> None:
"""Write the data this backend's queries read, without running a query.

Only `lance-bench` writes its own data: it converts the base Parquet files to Lance on its
first run. The run loop drops the OS caches before each query, so without this step the
first Lance query would read files that the conversion just left in the page cache.
"""
if self.backend is not Engine.LANCE:
return
cmd = [str(self.binary_path), benchmark.value, "--data-only"]
for key, value in (options or {}).items():
cmd.extend(["--opt", f"{key}={value}"])

if self.verbose:
console.print(f"[dim]$ {' '.join(cmd)}[/dim]")

result = subprocess.run(cmd, capture_output=True, text=True)
if result.returncode != 0:
raise RuntimeError(
f"Failed to write {self.backend.value} data for {benchmark.value}: {result.stderr.strip()}"
)

def list_queries(
self,
benchmark: Benchmark,
Expand Down
Loading
Loading