Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
158 commits
Select commit Hold shift + click to select a range
28163bf
Add split and open to the Scan API
gatesn Nov 19, 2026
525b565
Let pool workers spawn onto the session runtime
gatesn Nov 19, 2026
e468b71
Give layout scans a native split and open
gatesn Nov 19, 2026
540b8cc
Spawn pool splits onto the session runtime
gatesn Nov 19, 2026
f9241d7
Read DataFusion v2 scans through split and open
gatesn Nov 19, 2026
d135991
Split the v2 test scan into one piece per partition
gatesn Nov 19, 2026
be5ce7a
Convert scan workers to Arrow through vortex-arrow
gatesn Nov 19, 2026
d2b0617
Add a datafusion-bench flag for the Scan API table path
gatesn Nov 19, 2026
1703302
Report pool progress and exhaustion, and plan-time scan size
gatesn Nov 19, 2026
2d3e3e7
Keep the shared partition stream behind VORTEX_SCAN_POOL=0
gatesn Nov 20, 2026
8626a3f
Give layout scans a native split and open
gatesn Nov 19, 2026
d300a84
Spawn pool splits onto the session runtime
gatesn Nov 19, 2026
f1bf5cf
Drive layout pool tests with a background runtime
gatesn Nov 19, 2026
d10623d
Run pool splits the way execute_stream runs them
gatesn Nov 20, 2026
c638db4
Pass a pool's open slot on when its worker drops
gatesn Nov 20, 2026
5703e0e
Document split_concurrency for pool workers
gatesn Nov 20, 2026
3bc99c3
Merge the reworked scan-native-pool base
gatesn Nov 20, 2026
0cd40e4
Request shared segments without an exclusive lock
gatesn Nov 20, 2026
e716709
Merge ngates/scan-split-open into ngates/scan-native-pool
gatesn Nov 20, 2026
b38e894
Merge develop into ngates/scan-split-open
gatesn Nov 20, 2026
c2f3e57
Merge the final scan-native-pool foundation
gatesn Nov 20, 2026
c638960
Merge ngates/scan-split-open into ngates/scan-native-pool
gatesn Nov 20, 2026
3148faa
Say that hosts drive the runtime their pool workers spawn onto
gatesn Nov 20, 2026
7843fbc
Share an unordered pool's output instead of its work
gatesn Nov 20, 2026
a36941c
Merge the shared-output scan-native-pool foundation
gatesn Nov 20, 2026
4272dca
Stop assuming a scan pool's workers own their work
gatesn Nov 20, 2026
52a122f
Run an unordered pool's units on the lane that takes them
gatesn Nov 20, 2026
530b943
Recheck whole-file pruning when a pooled file's first split is taken
gatesn Nov 20, 2026
9996743
Start an unordered pool's lanes only as units are ready
gatesn Nov 20, 2026
235d539
Read an unordered pool's opened files in turn
gatesn Nov 20, 2026
27fa36a
Merge the file-rotating scan-native-pool foundation
gatesn Nov 20, 2026
3cd0419
Hand out an unordered pool's files in runs of adjacent splits
gatesn Nov 20, 2026
9d1bc30
Merge the coalescing scan-native-pool foundation
gatesn Nov 20, 2026
03bc34a
Decode a single-file pool's splits on every core
gatesn Nov 20, 2026
25e4243
Merge the parallel-decode scan-native-pool foundation
gatesn Nov 20, 2026
f405ee3
Merge develop into ngates/scan-split-open
gatesn Nov 20, 2026
8f81f78
Merge ngates/scan-split-open into ngates/scan-native-pool
gatesn Nov 20, 2026
86c9e14
Merge the scan-native-pool foundation with develop
gatesn Nov 20, 2026
794ac0c
Make split and open the methods every scan implements
gatesn Nov 20, 2026
bf0f763
Merge ngates/scan-split-open into ngates/scan-native-pool
gatesn Nov 20, 2026
5d18c27
Read V1 layout scans through split and open on develop's pipeline
gatesn Nov 20, 2026
ebbafe8
Merge the reworked scan-native-pool foundation
gatesn Nov 20, 2026
a68063c
Test group_contiguous against ranges grouped by their first row
gatesn Nov 20, 2026
9dc8962
Merge the scan-native-pool foundation's test fix
gatesn Nov 20, 2026
b414761
Keep develop's splits in flight when opening a file, and split inside…
gatesn Nov 20, 2026
ddd24ce
Merge the read-ahead scan-native-pool foundation
gatesn Nov 20, 2026
93e06a5
Require every scan pool to report when all its work is taken
gatesn Nov 20, 2026
90edccc
Merge ngates/scan-split-open into ngates/scan-native-pool
gatesn Nov 20, 2026
1685330
Keep multi-file split to runs of whole files
gatesn Nov 20, 2026
1d002df
Keep only the scan and pool methods the stack's hosts call
gatesn Nov 20, 2026
dc8caa3
Merge ngates/scan-split-open into ngates/scan-native-pool
gatesn Nov 20, 2026
570b1c3
Drop the layout pools' unused size and progress methods
gatesn Nov 20, 2026
43a207e
Merge the trimmed scan-native-pool foundation
gatesn Nov 20, 2026
b40dc55
Read each VortexTable output partition from its own split piece
gatesn Nov 20, 2026
39b4ebe
Require partitions again and drop ScanPool::dtype
gatesn Nov 20, 2026
1d1d7d7
Merge ngates/scan-split-open into ngates/scan-native-pool
gatesn Nov 20, 2026
40d7b33
Drop dtype from the split pool
gatesn Nov 20, 2026
6697509
Say that split_concurrency bounds each partition or worker
gatesn Nov 20, 2026
485b83e
Merge ngates/scan-split-open into ngates/scan-native-pool
gatesn Nov 20, 2026
4b7546e
Merge the scan-native-pool foundation with required partitions
gatesn Nov 20, 2026
17ddf34
Cut multi-file scans inside files when there are fewer files than pieces
gatesn Nov 20, 2026
4f3b62b
Split each VortexTable execution once and share its pieces
gatesn Nov 20, 2026
e36740d
Open scans into a cloneable ScanStream and define split by request order
gatesn Nov 20, 2026
0b40ba0
Merge ngates/scan-split-open into ngates/scan-native-pool
gatesn Nov 20, 2026
b6606f1
Merge #11663's ScanStream API and read pieces as streams
gatesn Nov 20, 2026
17e58eb
Rename vortex_scan::pool to stream and state the scan contract exactly
gatesn Nov 20, 2026
86065ee
Merge ngates/scan-split-open into ngates/scan-native-pool
gatesn Nov 20, 2026
5117956
Merge branch 'ngates/scan-native-pool' of github.com:vortex-data/vort…
gatesn Nov 20, 2026
1569d39
Describe to_arrow's input as a piece of a split scan
gatesn Nov 20, 2026
cef16c6
Describe split's callers as hosts that read a fixed number of streams
gatesn Nov 20, 2026
665ce62
Merge branch 'ngates/scan-split-open' into ngates/scan-native-pool
gatesn Nov 20, 2026
426cb19
Say what LayoutReaderScan::builder builds
gatesn Nov 20, 2026
7f80421
Cancel a scan execution when an unfinished output partition drops
gatesn Nov 20, 2026
00011de
Read two files at once per clone of an unordered multi-file scan
gatesn Nov 20, 2026
788789b
Merge branch 'ngates/scan-native-pool' of github.com:vortex-data/vort…
gatesn Nov 20, 2026
9d5c2fa
Report an opened scan's progress on its stream
gatesn Nov 20, 2026
cdb5fad
Read DuckDB's V1 scans through open
gatesn Nov 20, 2026
c7656fc
Clone a DuckDB file's scan stream under a lock
gatesn Nov 20, 2026
f869fdb
Run one split at a time on each DuckDB thread
gatesn Nov 20, 2026
28c6b76
Poll a DuckDB thread's split on that thread
gatesn Nov 20, 2026
db19654
Poll a worker's only split on the thread that reads it
gatesn Nov 20, 2026
1c038fa
Merge remote-tracking branch 'origin/ngates/scan-native-pool' into ng…
gatesn Nov 20, 2026
69408fc
Merge branch 'ngates/scan-native-pool' of github.com:vortex-data/vort…
gatesn Nov 20, 2026
a893611
Merge remote-tracking branch 'origin/ngates/datafusion-scan-pool' int…
gatesn Nov 20, 2026
f93a16d
Make split strictly partitioning and leave sharing to open
gatesn Nov 20, 2026
1d3a129
Merge branch 'ngates/scan-split-open' into ngates/scan-native-pool
gatesn Nov 20, 2026
1c91d11
Cut layout scans into fixed pieces for every request
gatesn Nov 20, 2026
9d11499
Share unordered scan work through clones of one opened stream
gatesn Nov 20, 2026
4fa8141
Describe the read-ahead without reference to split
gatesn Nov 20, 2026
ebcb6b4
Merge branch 'ngates/scan-native-pool' of github.com:vortex-data/vort…
gatesn Nov 20, 2026
a935b80
Merge remote-tracking branch 'origin/ngates/datafusion-scan-pool' int…
gatesn Nov 20, 2026
c102c2c
Read declared orderings through one ordered split piece per partition
gatesn Nov 20, 2026
4ed50ad
Merge remote-tracking branch 'origin/ngates/datafusion-scan-pool' int…
gatesn Nov 20, 2026
c55c047
Hold the shared scan stream behind a mutex so the execution is Sync
gatesn Nov 20, 2026
b20fb3e
Merge remote-tracking branch 'origin/ngates/datafusion-scan-pool' int…
gatesn Nov 20, 2026
2322eea
Move RowLimit and limit_rows into vortex-scan
gatesn Nov 20, 2026
8c50bcf
Move the V2 part planner into vortex-scan
gatesn Nov 20, 2026
6520fcd
Add a Scan API source over V2 plans whose open returns a ScanStream
gatesn Nov 20, 2026
d07b031
Expose Vortex files as Scan API sources over V2 plans
gatesn Nov 20, 2026
d1b14df
Read DuckDB V2 scans through the Scan API's open
gatesn Nov 20, 2026
1406380
Merge ngates/scan-exp-a-file-plan-source into ngates/scan-exp-a-duckd…
gatesn Nov 20, 2026
861a2ff
Merge ngates/scan-exp-a-plan-source into ngates/scan-exp-a-file-plan-…
gatesn Nov 20, 2026
bda4513
Merge ngates/scan-exp-a-part-root into ngates/scan-exp-a-plan-source
gatesn Nov 20, 2026
08ef467
Keep the futures::ready import that repeated_scan still uses
gatesn Nov 20, 2026
8ea37b9
Merge ngates/scan-exp-a-row-limit into ngates/scan-exp-a-part-root
gatesn Nov 20, 2026
9019620
Merge ngates/scan-exp-a-file-plan-source into ngates/scan-exp-a-duckd…
gatesn Nov 20, 2026
1542284
Merge ngates/scan-exp-a-plan-source into ngates/scan-exp-a-file-plan-…
gatesn Nov 20, 2026
5f32c1b
Name the sum type of a plan source's byte size
gatesn Nov 20, 2026
50e2dff
Drop DuckDB's globally bound projection, which only the V2 queue read
gatesn Nov 20, 2026
6645600
Merge ngates/scan-exp-a-plan-source into ngates/scan-exp-a-file-plan-…
gatesn Nov 21, 2026
9411ff7
Cut a V2 plan scan's parts in scan, so open reads nothing
gatesn Nov 21, 2026
e572270
Describe when a dynamic filter prunes a file in the plan source tests
gatesn Nov 21, 2026
1208605
Merge ngates/scan-exp-a-file-plan-source into ngates/scan-exp-a-duckd…
gatesn Nov 21, 2026
7fb994d
Stop DuckDB threads joining a file once its splits are covered
gatesn Nov 21, 2026
a4c5be8
Skip the executor in block_on when the future is already ready
gatesn Nov 23, 2026
09f5725
Merge ngates/scan-exp-a-part-root into ngates/scan-exp-a-plan-source
gatesn Nov 24, 2026
708dc99
Merge ngates/duckdb-scan-pool into ngates/scan-exp-a-row-limit
gatesn Nov 24, 2026
0bd72bb
Merge ngates/scan-exp-a-row-limit into ngates/scan-exp-a-part-root
gatesn Nov 24, 2026
c5d9897
Report a V2 plan scan's claimed parts on its stream
gatesn Nov 24, 2026
978b95f
Merge ngates/scan-exp-a-plan-source into ngates/scan-exp-a-file-plan-…
gatesn Nov 24, 2026
daeb219
Merge ngates/scan-exp-a-file-plan-source into ngates/scan-exp-a-duckd…
gatesn Nov 24, 2026
ae8d4bb
Re-run pull request checks
gatesn Nov 24, 2026
f213f73
Merge develop into ngates/scan-split-open
gatesn Nov 24, 2026
2f2556f
Merge ngates/scan-split-open into ngates/scan-native-pool
gatesn Nov 24, 2026
f4c7554
Merge ngates/scan-native-pool into ngates/datafusion-scan-pool
gatesn Nov 24, 2026
905e708
Merge ngates/datafusion-scan-pool into ngates/duckdb-scan-pool
gatesn Nov 24, 2026
8080e7c
Merge ngates/duckdb-scan-pool into ngates/scan-exp-a-row-limit
gatesn Nov 24, 2026
585c37c
Merge ngates/scan-exp-a-row-limit into ngates/scan-exp-a-part-root
gatesn Nov 24, 2026
b0189f0
Merge ngates/scan-exp-a-part-root into ngates/scan-exp-a-plan-source
gatesn Nov 24, 2026
1d97aa4
Merge ngates/scan-exp-a-plan-source into ngates/scan-exp-a-file-plan-…
gatesn Nov 24, 2026
387393e
Merge ngates/scan-exp-a-file-plan-source into ngates/scan-exp-a-duckd…
gatesn Nov 24, 2026
e946027
Import DynamicExprUpdates from vortex-functions, where develop moved it
gatesn Nov 24, 2026
211d1b1
Split and open the test array scan, which develop added
gatesn Nov 24, 2026
a74d391
Merge ngates/scan-split-open into ngates/scan-native-pool
gatesn Nov 24, 2026
24b6662
Merge ngates/scan-native-pool into ngates/datafusion-scan-pool
gatesn Nov 24, 2026
ea4b2ec
Merge ngates/datafusion-scan-pool into ngates/duckdb-scan-pool
gatesn Nov 24, 2026
2b682b0
Merge ngates/duckdb-scan-pool into ngates/scan-exp-a-row-limit
gatesn Nov 24, 2026
52a0ebc
Merge ngates/scan-exp-a-row-limit into ngates/scan-exp-a-part-root
gatesn Nov 24, 2026
326b2d5
Merge ngates/scan-exp-a-part-root into ngates/scan-exp-a-plan-source
gatesn Nov 24, 2026
f03b657
Merge ngates/scan-exp-a-file-plan-source into ngates/scan-exp-a-duckd…
gatesn Nov 24, 2026
be97482
Merge ngates/scan-exp-a-plan-source into ngates/scan-exp-a-file-plan-…
gatesn Nov 24, 2026
a98a556
Merge ngates/scan-exp-a-file-plan-source into ngates/scan-exp-a-duckd…
gatesn Nov 24, 2026
ee73865
Import the moved dynamic and CompareOperator in the plan source tests
gatesn Nov 24, 2026
911088f
Drop DuckDB's unused DynamicExprUpdates import
gatesn Nov 24, 2026
db07453
Open a scan into a shared ScanExec that hands out streams
gatesn Nov 24, 2026
5d00179
Merge ngates/scan-split-open into ngates/scan-native-pool
gatesn Nov 24, 2026
006e810
Merge ngates/scan-native-pool into ngates/datafusion-scan-pool
gatesn Nov 24, 2026
deaddfa
Merge ngates/datafusion-scan-pool into ngates/duckdb-scan-pool
gatesn Nov 24, 2026
dabfcab
Merge ngates/duckdb-scan-pool into ngates/scan-exp-a-row-limit
gatesn Nov 24, 2026
f29f092
Merge ngates/scan-exp-a-row-limit into ngates/scan-exp-a-part-root
gatesn Nov 24, 2026
c03d082
Merge ngates/scan-exp-a-part-root into ngates/scan-exp-a-plan-source
gatesn Nov 24, 2026
c722c01
Open a plan source scan into a ScanExec
gatesn Nov 24, 2026
bd5559b
Merge ngates/scan-exp-a-plan-source into ngates/scan-exp-a-file-plan-…
gatesn Nov 24, 2026
ee338d2
Merge ngates/scan-exp-a-file-plan-source into ngates/scan-exp-a-duckd…
gatesn Nov 24, 2026
3e0c431
Describe opened scans as handing out streams
gatesn Nov 24, 2026
401ede3
Merge ngates/scan-exp-a-plan-source into ngates/scan-exp-a-file-plan-…
gatesn Nov 24, 2026
bd6d384
Merge ngates/scan-exp-a-file-plan-source into ngates/scan-exp-a-duckd…
gatesn Nov 24, 2026
e1f3d50
Merge ngates/block-on-ready-fast-path into ngates/scan-api-bench
gatesn Nov 24, 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
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions vortex-arrow/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ vortex-array = { workspace = true }
vortex-buffer = { workspace = true, features = ["arrow"] }
vortex-error = { workspace = true }
vortex-functions = { workspace = true }
vortex-io = { workspace = true }
vortex-mask = { workspace = true }
vortex-scan = { workspace = true }
vortex-session = { workspace = true }
Expand Down
2 changes: 2 additions & 0 deletions vortex-arrow/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ mod run_end_import;
mod scalar;
mod scan;
mod session;
mod stream;
#[cfg(feature = "_test-harness")]
pub mod test_harness;
#[cfg(test)]
Expand All @@ -55,3 +56,4 @@ pub use options::*;
pub use scalar::ToArrowDatum;
pub use scan::ArrowScanExt;
pub use session::*;
pub use stream::ArrowArrayStreamExt;
116 changes: 116 additions & 0 deletions vortex-arrow/src/stream.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
// SPDX-License-Identifier: Apache-2.0
// SPDX-FileCopyrightText: Copyright the Vortex contributors

//! Arrow output for array streams.

use std::future;
use std::num::NonZeroUsize;
use std::sync::Arc;

use arrow_array::RecordBatch;
use arrow_array::cast::AsArray;
use arrow_schema::Field;
use arrow_schema::SchemaRef;
use futures::StreamExt;
use futures::stream;
use futures::stream::BoxStream;
use vortex_array::VortexSessionExecute;
use vortex_array::stream::ArrayStream;
use vortex_error::VortexResult;
use vortex_io::session::RuntimeSessionExt;
use vortex_session::VortexSession;

use crate::ArrowSessionExt;
use crate::ExecuteArrowExt;

/// Arrow record-batch output for an [`ArrayStream`], such as a piece of a split scan.
pub trait ArrowArrayStreamExt: ArrayStream + Send + Sized + 'static {
/// Converts each array of the stream to an Arrow [`RecordBatch`] with `schema`.
///
/// Each conversion runs as a CPU task on the session's runtime, with at most `concurrency`
/// in flight, and the batches keep the stream's order. When `schema` is `None`, the session
/// derives it from the stream's dtype.
fn to_arrow(
self,
session: &VortexSession,
schema: Option<SchemaRef>,
concurrency: NonZeroUsize,
) -> BoxStream<'static, VortexResult<RecordBatch>> {
let schema = match schema {
Some(schema) => schema,
None => match session.arrow().to_arrow_schema(self.dtype()) {
Ok(schema) => Arc::new(schema),
Err(error) => return stream::once(future::ready(Err(error))).boxed(),
},
};
let field = Arc::new(Field::new_struct("", schema.fields().clone(), false));
let session = session.clone();
let handle = session.handle();
self.map(move |array| {
let session = session.clone();
let field = Arc::clone(&field);
handle.spawn_cpu(move || {
let arrow =
array?.execute_arrow(Some(&field), &mut session.create_execution_ctx())?;
Ok(RecordBatch::from(arrow.as_struct().clone()))
})
})
.buffered(concurrency.get())
.boxed()
}
}

impl<S: ArrayStream + Send + 'static> ArrowArrayStreamExt for S {}

#[cfg(test)]
mod tests {
use std::num::NonZeroUsize;

use arrow_array::cast::AsArray;
use arrow_array::types::Int32Type;
use futures::TryStreamExt;
use futures::stream;
use vortex_array::IntoArray;
use vortex_array::arrays::StructArray;
use vortex_array::stream::ArrayStreamAdapter;
use vortex_buffer::buffer;
use vortex_error::VortexResult;
use vortex_io::runtime::single::block_on;
use vortex_io::session::RuntimeSessionExt;
use vortex_session::VortexSession;

use super::ArrowArrayStreamExt;

#[test]
fn converts_each_array_in_order() -> VortexResult<()> {
let arrays = [buffer![0i32, 1], buffer![2i32], buffer![3i32, 4, 5]]
.into_iter()
.map(|values| {
StructArray::from_fields(&[("a", values.into_array())]).map(IntoArray::into_array)
})
.collect::<VortexResult<Vec<_>>>()?;
let dtype = arrays[0].dtype().clone();
let batches: Vec<_> = block_on(|handle| {
let session = VortexSession::empty().with_handle(handle);
ArrayStreamAdapter::new(dtype, stream::iter(arrays.into_iter().map(Ok)))
.to_arrow(
&session,
None,
NonZeroUsize::new(2).unwrap_or(NonZeroUsize::MIN),
)
.try_collect()
})?;
let values: Vec<i32> = batches
.iter()
.flat_map(|batch| {
batch
.column(0)
.as_primitive::<Int32Type>()
.values()
.to_vec()
})
.collect();
assert_eq!(values, [0, 1, 2, 3, 4, 5]);
Ok(())
}
}
1 change: 1 addition & 0 deletions vortex-datafusion/src/v2/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,6 @@ mod table;
#[cfg(test)]
mod tests;

pub use source::SCAN_POOL_ENV;
pub use source::VortexDataSource;
pub use table::VortexTable;
Loading
Loading