Skip to main content

ParquetStore

Struct ParquetStore 

Source
pub struct ParquetStore { /* private fields */ }
Expand description

Parquet-based storage backend for tick and bar data.

Implementations§

Source§

impl ParquetStore

Source

pub fn open(root: impl AsRef<Path>) -> Result<Self>

Open a Parquet data store rooted at the given directory, creating it if needed.

Source

pub fn insert_ticks(&self, ticks: &[Tick]) -> Result<usize>

Import ticks, deduplicating against existing data per date partition. Returns the number of rows actually inserted (after dedup).

Source

pub fn insert_bars(&self, bars: &[Bar]) -> Result<usize>

Import bars, deduplicating against existing data per date partition. Returns the number of rows actually inserted (after dedup).

Source

pub fn query_ticks(&self, opts: &QueryOpts) -> Result<(Vec<Tick>, u64)>

Query ticks for a given exchange+symbol, optionally filtered by date range. Returns (ticks, total_count_matching_filters).

Source

pub fn query_bars(&self, opts: &BarQueryOpts) -> Result<(Vec<Bar>, u64)>

Query bars for a given exchange+symbol+timeframe, optionally filtered by date range. Returns (bars, total_count_matching_filters).

Source

pub fn delete_ticks( &self, exchange: &str, symbol: &str, from: Option<NaiveDateTime>, to: Option<NaiveDateTime>, ) -> Result<usize>

Delete ticks matching exchange+symbol, optionally within a date range.

Source

pub fn delete_bars( &self, exchange: &str, symbol: &str, timeframe: &str, from: Option<NaiveDateTime>, to: Option<NaiveDateTime>, ) -> Result<usize>

Delete bars matching exchange+symbol+timeframe, optionally within a date range.

Source

pub fn delete_symbol( &self, exchange: &str, symbol: &str, ) -> Result<(usize, usize)>

Delete ALL data (ticks + bars) for an exchange+symbol pair.

Source

pub fn delete_exchange(&self, exchange: &str) -> Result<(usize, usize)>

Delete ALL data for an entire exchange.

Source

pub fn stats( &self, exchange: Option<&str>, symbol: Option<&str>, ) -> Result<Vec<StatRow>>

Summary statistics across all data, optionally filtered by exchange and/or symbol.

Source

pub fn total_size(&self) -> Option<u64>

Total size of all Parquet files under the data root (bytes).

Auto Trait Implementations§

Blanket Implementations§

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<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V