Skip to main content

ConvertSource

Enum ConvertSource 

Source
pub enum ConvertSource {
    Single(SingleSource),
    Multi(MultiSource),
}
Expand description

A resolved conversion input: one parquet file/object, or an ordered set of local parquet partitions read as one logical dataset.

Variants§

§

Single(SingleSource)

A single parquet file or remote object (the historical input shape).

§

Multi(MultiSource)

An ordered, validated set of local parquet partitions.

Implementations§

Source§

impl ConvertSource

Source

pub fn single(source: InputSource) -> Self

Wrap an already-constructed InputSource (single file/object).

Source

pub fn resolve(input: &str) -> Result<Self, InputError>

Resolve a CLI-style input string:

  • existing local file → Single (byte-identical behavior to today);
  • existing local directory → recursive .parquet collection (sorted; _/.-prefixed basenames such as _SUCCESS skipped);
  • string containing glob metacharacters (*?[) → glob expansion, filtered to .parquet files, sorted, deduplicated;
  • remote single-object URL (no trailing slash — including extension-less presigned/API URLs) → Single (unchanged);
  • s3:// / gs:// prefix (path ending /) → native object listing: .parquet keys sorted by key, _SUCCESS/zero-byte/ hidden (./_) names skipped, one store instance shared by all parts; requires the remote feature (without it, the standard InputError::RemoteDisabled as before);
  • http(s):// prefix → InputError::RemotePrefixUnsupported (no generic listing API; the error points at --files-from);
  • a single resolved partition collapses to Single;
  • an empty directory/glob result → InputError::NoParquetInputs.
Source

pub fn from_manifest(manifest: &Path) -> Result<Self, InputError>

Build a source from a --files-from manifest: one local path or remote URL per line, #-prefixed comment lines and blank lines skipped, entries trimmed. Line order is preserved VERBATIM — never sorted — because the converter’s row-order invariant keys winner tables by global row offset; reordering the manifest reorders the dataset. Each line is resolved as a SINGLE file/object (no directory, glob, or prefix expansion); mixing local and remote entries is allowed (compatibility is validated as usual).

Source

pub fn from_input_list<S: AsRef<str>>(inputs: &[S]) -> Result<Self, InputError>

Build a source from an explicit ordered list of inputs (local paths or URLs) — the Python list[str] input shape. Order is preserved verbatim; each entry is a single file/object (no expansion).

Source

pub fn resolve_path(path: &Path) -> Result<Self, InputError>

ConvertSource::resolve for Path inputs (non-UTF-8 paths fall back to a single local source, as InputSource::from_path does).

Source

pub fn parts(&self) -> &[InputSource]

The underlying parts, in read order (a single source is one part).

Source

pub fn is_remote(&self) -> bool

Whether any part is remote.

Source

pub fn set_spill_dir(&self, dir: Option<&Path>)

Place the remote-input disk spill in dir for every part (#272). No-op for local parts, which never spill.

Source

pub fn display_name(&self) -> String

Human-readable input name: the path/URL for a single source, "<root> (N partitions)" for a multi source.

Source

pub fn schema(&self) -> Result<SchemaRef, InputError>

The Arrow schema of the dataset. For a multi source this is the validated union schema (nullability OR-ed across parts). After Self::restrict_columns, only the kept columns, in file order.

Source

pub fn file_schema(&self) -> Result<SchemaRef, InputError>

The unprojected schema: every column the files carry, whether or not Self::restrict_columns has narrowed what reads return.

Source

pub fn restrict_columns(&self, keep: Vec<usize>) -> Result<(), InputError>

Restrict every later read — and Self::schema — to these root columns of the file schema, sorted ascending (#386). Applied once, before anything derives column indices from the schema, so every downstream index is already relative to the projected layout and the excluded columns are never decoded (a remote input still stages every chunk of a row group; only the decode is skipped). A second call is a programming error.

Source

pub fn column_projection(&self) -> Option<&[usize]>

The root columns reads are restricted to, if any (see Self::restrict_columns).

Source

pub fn key_value_metadata(&self) -> Result<Option<Vec<KeyValue>>, InputError>

Parquet key-value metadata of partition 0 (the geo metadata used for CRS detection; construction validated all parts agree).

Source

pub fn num_row_groups_total(&self) -> Result<usize, InputError>

Total number of row groups across all parts.

Source

pub fn select_row_groups( &self, bbox_units: &[f64; 4], ) -> Result<RowGroupSelection, InputError>

Per-part bbox row-group selection (#102): applies the single-file covering-statistics pruning to each part independently. bbox_units is [xmin, ymin, xmax, ymax] in the file CRS units.

Source

pub fn select_row_groups_matching( &self, filter: &BoundFilter, ) -> Result<RowGroupSelection, InputError>

Per-part attribute-filter row-group selection (#315): applies the bound filter’s column-statistics pushdown (crate::overview::filter::BoundFilter::select_row_groups) to each part independently. Conservative — groups without usable statistics are kept.

Source

pub fn selected_input_bytes( &self, selection: Option<&RowGroupSelection>, ) -> Result<u64, InputError>

Total compressed bytes of the selected row groups (None = every row group of every part) — the projected disk-spill size the #272 free-space preflight consults. Per-part sums come from the shared single-file helper crate::input::selected_compressed_bytes.

Source

pub fn fetch_stats(&self) -> Option<FetchStats>

Fetch counters summed over remote parts (None when no part is remote). object_size is the summed size of the remote objects.

Source

pub fn stage_selected( &self, selection: Option<&RowGroupSelection>, ) -> Result<(), InputError>

Stage every part’s selected row groups to local disk up front (pass 0, #286/#287) so the streaming passes read from disk, not the network.

Each remote part coalesces its selected row groups into one parallel range request per row group (a row group is a contiguous byte span); local parts are no-ops. Parts are staged in order so resident memory stays bounded by one part’s in-flight spans. selection (None = all row groups) is the per-part bbox pruning the passes will honor, so pruned groups are never fetched and total network traffic stays ≈1× the input (#219). Errors are the caller’s to handle; the streaming pipeline treats staging as best-effort (a network error here is one the passes would hit anyway).

Source

pub fn open_stream( &self, plan: &ReadPlan<'_>, ) -> Result<SourceStream<'_>, InputError>

Open a sequential batch stream over all parts (see SourceStream).

Trait Implementations§

Source§

impl Debug for ConvertSource

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Allocation for T
where T: RefUnwindSafe + Send + Sync,

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<G1, G2> Within<G2> for G1
where G2: Contains<G1>,

Source§

fn is_within(&self, b: &G2) -> bool