1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
// SPDX-License-Identifier: Apache-2.0
// SPDX-FileCopyrightText: Copyright the Vortex contributors
use ScanBuilder;
use Selection;
/// Additional Vortex-specific scan constraints attached to a
/// [`PartitionedFile`].
///
/// `VortexAccessPlan` is the hook to use when an external index or planner
/// already knows that only part of a file needs to be scanned. The plan is
/// attached as `extensions` on `PartitionedFile`, and the internal
/// `VortexOpener` applies it before building the Vortex scan.
///
/// The current access plan surface is intentionally small: it lets callers
/// provide a [`Selection`] that narrows the rows considered by the scan.
///
/// # Example
///
/// ```no_run
/// # use std::sync::Arc;
/// # use datafusion_datasource::PartitionedFile;
/// # use vortex::scan::selection::Selection;
/// use vortex_datafusion::VortexAccessPlan;
///
/// # let selection: Selection = todo!();
/// let file = PartitionedFile::new("metrics.vortex", 1024).with_extensions(Arc::new(
/// VortexAccessPlan::default().with_selection(selection),
/// ));
/// # let _ = file;
/// ```
///
/// This is a low-level integration point for systems building their own access
/// paths on top of DataFusion. For a conceptually similar Parquet example, see
/// DataFusion's
/// [`parquet_advanced_index`].
///
/// [`PartitionedFile`]: datafusion_datasource::PartitionedFile
/// [`parquet_advanced_index`]: https://github.com/apache/datafusion/blob/47df535d2cd5aac5ad5a92bdc837f38e05ea0f0f/datafusion-examples/examples/data_io/parquet_advanced_index.rs