mod error;
mod operations;
pub use operations::append;
pub use operations::{
AppendError, CoverageQueryError, CreateTableError, OpenTableError, OptimizeError,
OptimizeReport, ScanError, TableStateAccessError,
};
#[cfg(test)]
pub(crate) mod test_util;
#[cfg(test)]
mod latest_snapshot_tests;
use std::pin::Pin;
use arrow::array::RecordBatch;
use futures::Stream;
use crate::{
metadata::protocol::TableProtocolError,
storage::TableLocation,
transaction_log::{IndexSpec, TableState, TransactionLogStore},
};
pub use crate::formats::parquet::EntityRewriteError;
pub use error::TableError;
pub type TimeSeriesScan = Pin<Box<dyn Stream<Item = Result<RecordBatch, TableError>> + Send>>;
#[derive(Debug, Clone)]
pub struct TimeSeriesTable {
log: TransactionLogStore,
state: TableState,
index: IndexSpec,
}
impl TimeSeriesTable {
pub fn state(&self) -> &TableState {
&self.state
}
#[allow(dead_code)]
pub(crate) fn state_mut(&mut self) -> &mut TableState {
&mut self.state
}
pub fn index_spec(&self) -> &IndexSpec {
&self.index
}
pub fn location(&self) -> &TableLocation {
self.log.location()
}
pub(crate) fn ensure_write_compatible(&self) -> Result<(), TableProtocolError> {
self.state.table_meta.ensure_write_compatible()
}
}