Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 5 additions & 1 deletion bench-orchestrator/bench_orchestrator/ci_matrix/catalog.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
# Vortex targets name an integration (`file`, `datasource`) and a scan engine (`v1`, `v2`); see
# `BenchmarkTarget`. Declared targets run the file integration on the suite's default engine.
# `ScanCoverage.ALL` adds every other valid combination for the `vortex` format: DataFusion file-v1 and
# datasource-v1 beside file-v2, and DuckDB file-v1 beside file-v2, on V2 suites. Each combination runs
# datasource-v2 and datasource-v1 beside file-v2, and DuckDB file-v1 beside file-v2, on V2 suites. Each combination runs
# as a matrix entry, and so a machine, of its own, so covering them all adds machines, not wall time.


Expand Down Expand Up @@ -108,6 +108,10 @@ def with_all_scans(coverage: Coverage) -> Coverage:
BenchmarkTarget(Engine.DATAFUSION, Format.VORTEX, Integration.FILE, ScanEngine.V1),
"DataFusion, Vortex, file v1",
),
(
BenchmarkTarget(Engine.DATAFUSION, Format.VORTEX, Integration.DATASOURCE, ScanEngine.V2),
"DataFusion, Vortex, datasource v2",
),
(
BenchmarkTarget(Engine.DATAFUSION, Format.VORTEX, Integration.DATASOURCE, ScanEngine.V1),
"DataFusion, Vortex, datasource v1",
Expand Down
9 changes: 1 addition & 8 deletions bench-orchestrator/bench_orchestrator/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,9 +132,7 @@ class Benchmark(Enum):
SUPPORTED_SCANS: dict[Engine, dict[Integration, frozenset[ScanEngine]]] = {
Engine.DATAFUSION: {
Integration.FILE: frozenset({ScanEngine.V1, ScanEngine.V2}),
# `VortexTable` reaches only V1: `MultiFileDataSource` opens `LayoutReader`s. V2 needs the V2
# scan behind `split`/`open` (#11626).
Integration.DATASOURCE: frozenset({ScanEngine.V1}),
Integration.DATASOURCE: frozenset({ScanEngine.V1, ScanEngine.V2}),
},
Engine.DUCKDB: {
Integration.FILE: frozenset({ScanEngine.V1, ScanEngine.V2}),
Expand Down Expand Up @@ -168,11 +166,6 @@ def scan_support_error(engine: Engine, integration: Integration, scan: ScanEngin
return "duckdb has no DataSource table function yet, so it has no datasource targets"
return f"{engine.value} has no {integration.value} integration"
if scan is not None and scan not in integrations[integration]:
if engine is Engine.DATAFUSION and integration is Integration.DATASOURCE and scan is ScanEngine.V2:
return (
"datafusion datasource targets run only the v1 scan: MultiFileDataSource opens "
"LayoutReaders, and v2 needs the V2 scan behind split/open (#11626)"
)
return f"{engine.value} {integration.value} targets cannot run the {scan.value} scan"
return None

Expand Down
2 changes: 1 addition & 1 deletion bench-orchestrator/tests/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,9 +202,9 @@ def test_parse_targets_json_rejects_unknown_axes() -> None:
(Engine.DATAFUSION, Integration.FILE, ScanEngine.V1, None),
(Engine.DATAFUSION, Integration.FILE, ScanEngine.V2, None),
(Engine.DATAFUSION, Integration.DATASOURCE, ScanEngine.V1, None),
(Engine.DATAFUSION, Integration.DATASOURCE, ScanEngine.V2, None),
(Engine.DUCKDB, Integration.FILE, ScanEngine.V1, None),
(Engine.DUCKDB, Integration.FILE, ScanEngine.V2, None),
(Engine.DATAFUSION, Integration.DATASOURCE, ScanEngine.V2, "datasource targets run only the v1 scan"),
(Engine.DUCKDB, Integration.DATASOURCE, ScanEngine.V1, "duckdb has no DataSource table function yet"),
(Engine.DUCKDB, Integration.DATASOURCE, ScanEngine.V2, "duckdb has no DataSource table function yet"),
],
Expand Down
10 changes: 7 additions & 3 deletions bench-orchestrator/tests/test_matrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@
"duckdb-parquet",
"duckdb-vortex",
"datafusion-vortex-file-v1",
"datafusion-vortex-datasource-v2",
"datafusion-vortex-datasource-v1",
"duckdb-vortex-file-v1",
)
Expand All @@ -83,7 +84,7 @@
"tpch-nested-s3",
),
}
SCAN_SUFFIXES = ("datafusion-file-v1", "datafusion-datasource-v1", "duckdb-file-v1")
SCAN_SUFFIXES = ("datafusion-file-v1", "datafusion-datasource-v2", "datafusion-datasource-v1", "duckdb-file-v1")


def _entries(preset: str) -> list[dict[str, object]]:
Expand Down Expand Up @@ -121,6 +122,7 @@ def _group_targets(preset: str) -> dict[str, set[tuple[str, str]]]:
("datafusion", "parquet"),
("datafusion", "vortex [file, v2]"),
("datafusion", "vortex [file, v1]"),
("datafusion", "vortex [datasource, v2]"),
("datafusion", "vortex [datasource, v1]"),
("duckdb", "parquet"),
("duckdb", "vortex [file, v2]"),
Expand Down Expand Up @@ -197,11 +199,11 @@ def test_tpcds_sf100_runs_one_target_per_job() -> None:
entry for entry in _entries("nightly") if str(entry["id"]).startswith("tpcds-") and "-100-" in str(entry["id"])
]

assert len(nightly) == 14
assert len(nightly) == 16
assert all(len(_targets(entry)) == 1 for entry in nightly)
assert {target for entry in nightly for target in _targets(entry)} == ALL_SCANS
s3_keys = [entry["remote_key"] for entry in nightly if "remote_key" in entry]
assert len(s3_keys) == len(set(s3_keys)) == 7
assert len(s3_keys) == len(set(s3_keys)) == 8


def test_nightly_runs_every_scan() -> None:
Expand Down Expand Up @@ -251,6 +253,8 @@ def test_nightly_runs_every_valid_scan() -> None:
)
if not benchmark_id.startswith("tpch-nested"):
expected |= {(engine, "vortex [file, v2]") for engine in engines}
if "datafusion" in engines:
expected.add(("datafusion", "vortex [datasource, v2]"))
assert scans == expected, benchmark_id


Expand Down
28 changes: 16 additions & 12 deletions benchmarks/datafusion-bench/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ use vortex::file::multi::MultiFileDataSource;
use vortex::io::filesystem::FileSystemRef;
use vortex::io::object_store::ObjectStoreFileSystem;
use vortex::io::session::RuntimeSessionExt;
use vortex::scan::DataSource as _;
use vortex::scan::DataSourceRef;
use vortex_arrow::ArrowSessionExt;
use vortex_bench::Benchmark;
Expand Down Expand Up @@ -125,8 +124,7 @@ struct Args {
scan_v1: bool,

/// Register Vortex tables through the Scan API (`VortexTable` over a `MultiFileDataSource`)
/// instead of a listing table, whatever `--scan-v1` says. `MultiFileDataSource` runs the V1
/// scan.
/// instead of a listing table. `--scan-v1` still picks the scan the tables run on.
#[arg(long, default_value_t = false, action = clap::ArgAction::Set)]
scan_api: bool,

Expand Down Expand Up @@ -268,7 +266,7 @@ async fn register_benchmark_tables<B: Benchmark + ?Sized>(
scan_api: bool,
) -> anyhow::Result<()> {
if scan_api && matches!(format, Format::OnDiskVortex | Format::VortexCompact) {
register_v2_tables(session, benchmark, format).await
register_scan_api_tables(session, benchmark, format, scan_v2).await
} else {
let benchmark_base = benchmark.data_url().join(&format!("{}/", format.name()))?;
let file_format = format_to_df_format(format, scan_v2)?;
Expand Down Expand Up @@ -304,11 +302,16 @@ async fn register_benchmark_tables<B: Benchmark + ?Sized>(
}
}

/// Register tables using the Scan API path: a `VortexTable` over a `MultiFileDataSource`.
async fn register_v2_tables<B: Benchmark + ?Sized>(
/// Register tables through the Scan API: a `VortexTable` over a `MultiFileDataSource`.
///
/// With `scan_v2`, the table scans its files on the planner-driven scan through
/// [`MultiFileDataSource::build_plan`], whose files open as the scan reaches them. Otherwise it
/// scans them on layout readers through [`MultiFileDataSource::build`].
async fn register_scan_api_tables<B: Benchmark + ?Sized>(
session: &SessionContext,
benchmark: &B,
format: Format,
scan_v2: bool,
) -> anyhow::Result<()> {
let benchmark_base = benchmark.data_url().join(&format!("{}/", format.name()))?;

Expand All @@ -332,13 +335,14 @@ async fn register_v2_tables<B: Benchmark + ?Sized>(
None => format!("*.{}", format.ext()),
};

let multi_ds = MultiFileDataSource::new(SESSION.clone())
.with_glob(glob_pattern, Some(fs))
.build()
.await?;
let builder = MultiFileDataSource::new(SESSION.clone()).with_glob(glob_pattern, Some(fs));
let data_source: DataSourceRef = if scan_v2 {
builder.build_plan().await?
} else {
Arc::new(builder.build().await?)
};

let arrow_schema = Arc::new(SESSION.arrow().to_arrow_schema(multi_ds.dtype())?);
let data_source: DataSourceRef = Arc::new(multi_ds);
let arrow_schema = Arc::new(SESSION.arrow().to_arrow_schema(data_source.dtype())?);

let table_provider = Arc::new(VortexTable::new(data_source, SESSION.clone(), arrow_schema));
session.register_table(table.name, table_provider)?;
Expand Down
Loading