pub struct ParquetSource { /* private fields */ }Expand description
A Parquet file data source with metadata reading and efficient querying.
§Examples
ⓘ
use term_guard::sources::{ParquetSource, ParquetOptions};
// Simple Parquet file
let source = ParquetSource::new("data/events.parquet")?;
// Parquet with custom options
let options = ParquetOptions {
enable_pruning: false,
batch_size: 16384,
..Default::default()
};
let source = ParquetSource::with_options("data/events.parquet", options)?;
// Multiple files with glob pattern
let source = ParquetSource::from_glob("data/year=2023/*.parquet").await?;Implementations§
Source§impl ParquetSource
impl ParquetSource
Sourcepub fn new(path: impl Into<String>) -> Result<Self>
pub fn new(path: impl Into<String>) -> Result<Self>
Creates a new Parquet source from a single file path.
Sourcepub fn with_options(
path: impl Into<String>,
options: ParquetOptions,
) -> Result<Self>
pub fn with_options( path: impl Into<String>, options: ParquetOptions, ) -> Result<Self>
Creates a new Parquet source with custom options.
Sourcepub fn from_paths(paths: Vec<String>) -> Result<Self>
pub fn from_paths(paths: Vec<String>) -> Result<Self>
Creates a Parquet source from multiple file paths.
Sourcepub async fn from_glob(pattern: impl Into<String>) -> Result<Self>
pub async fn from_glob(pattern: impl Into<String>) -> Result<Self>
Creates a Parquet source from a glob pattern.
Sourcepub async fn from_globs(patterns: Vec<String>) -> Result<Self>
pub async fn from_globs(patterns: Vec<String>) -> Result<Self>
Creates a Parquet source from multiple glob patterns.
Sourcepub fn with_custom_options(self, options: ParquetOptions) -> Self
pub fn with_custom_options(self, options: ParquetOptions) -> Self
Sets custom options for this Parquet source.
Trait Implementations§
Source§impl Clone for ParquetSource
impl Clone for ParquetSource
Source§fn clone(&self) -> ParquetSource
fn clone(&self) -> ParquetSource
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl DataSource for ParquetSource
impl DataSource for ParquetSource
Source§fn register_with_telemetry<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
ctx: &'life1 SessionContext,
table_name: &'life2 str,
telemetry: Option<&'life3 Arc<TermTelemetry>>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn register_with_telemetry<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
ctx: &'life1 SessionContext,
table_name: &'life2 str,
telemetry: Option<&'life3 Arc<TermTelemetry>>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Registers this data source with telemetry support. Read more
Source§fn schema(&self) -> Option<&Arc<Schema>>
fn schema(&self) -> Option<&Arc<Schema>>
Returns the schema of this data source if known. Read more
Source§fn description(&self) -> String
fn description(&self) -> String
Returns a human-readable description of this data source.
Source§fn register<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
ctx: &'life1 SessionContext,
table_name: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn register<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
ctx: &'life1 SessionContext,
table_name: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Registers this data source with the given session context. Read more
Auto Trait Implementations§
impl Freeze for ParquetSource
impl RefUnwindSafe for ParquetSource
impl Send for ParquetSource
impl Sync for ParquetSource
impl Unpin for ParquetSource
impl UnwindSafe for ParquetSource
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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