RelationFileExt

Trait RelationFileExt 

Source
pub trait RelationFileExt: Relation {
    // Required methods
    fn from_parquet<P: AsRef<Path>>(filepath: P) -> Result<Self, Error>
       where Self: Sized;
    fn from_csv<P: AsRef<Path>>(filepath: P) -> Result<Self, Error>
       where Self: Sized;
}
Expand description

Extension trait for Relation to add file reading capabilities.

Required Methods§

Source

fn from_parquet<P: AsRef<Path>>(filepath: P) -> Result<Self, Error>
where Self: Sized,

Creates a new relation from a Parquet file with header.

This method extracts column names from the Parquet schema and the relation name from the filename.

Source

fn from_csv<P: AsRef<Path>>(filepath: P) -> Result<Self, Error>
where Self: Sized,

Creates a new relation from a CSV file.

§Note
  • Each line represents a tuple, and each value in the line should be parsable into Relation::KT.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<R> RelationFileExt for R
where R: Relation,

Blanket implementation of RelationFileExt for any type that implements Relation.