timeseries_table_format/
table.rs1mod error;
7mod operations;
8
9pub use operations::append;
10pub use operations::{
11 AppendError, CoverageQueryError, CreateTableError, OpenTableError, OptimizeError,
12 OptimizeReport, ScanError, TableStateAccessError, VacuumArtifact, VacuumArtifactDisposition,
13 VacuumArtifactReason, VacuumError, VacuumMode, VacuumReport,
14};
15
16#[cfg(test)]
17pub(crate) mod test_util;
18
19#[cfg(test)]
20mod latest_snapshot_tests;
21
22use std::pin::Pin;
23
24use arrow::array::RecordBatch;
25use futures::Stream;
26
27use crate::{
28 metadata::protocol::TableProtocolError,
29 storage::TableLocation,
30 transaction_log::{IndexSpec, TableState, TransactionLogStore},
31};
32
33pub use crate::formats::parquet::EntityRewriteError;
34pub use error::TableError;
35
36pub type TimeSeriesScan = Pin<Box<dyn Stream<Item = Result<RecordBatch, TableError>> + Send>>;
40
41#[derive(Debug, Clone)]
46pub struct TimeSeriesTable {
47 log: TransactionLogStore,
48 state: TableState,
49 index: IndexSpec,
50}
51
52impl TimeSeriesTable {
53 pub fn state(&self) -> &TableState {
55 &self.state
56 }
57
58 #[allow(dead_code)]
60 pub(crate) fn state_mut(&mut self) -> &mut TableState {
61 &mut self.state
62 }
63
64 pub fn index_spec(&self) -> &IndexSpec {
66 &self.index
67 }
68
69 pub fn location(&self) -> &TableLocation {
71 self.log.location()
72 }
73
74 pub(crate) fn ensure_write_compatible(&self) -> Result<(), TableProtocolError> {
75 self.state.table_meta.ensure_write_compatible()
76 }
77}