pub(crate) mod bin_pack;
mod bucket_filter;
mod commit_message;
mod data_evolution_reader;
pub mod data_evolution_writer;
mod data_file_reader;
mod data_file_writer;
#[cfg(feature = "fulltext")]
mod full_text_search_builder;
pub(crate) mod global_index_scanner;
mod read_builder;
pub(crate) mod rest_env;
pub(crate) mod row_id_predicate;
pub(crate) mod schema_manager;
pub(crate) mod snapshot_commit;
mod snapshot_manager;
mod source;
mod stats_filter;
pub(crate) mod table_commit;
mod table_read;
mod table_scan;
pub(crate) mod table_write;
mod tag_manager;
mod write_builder;
use crate::Result;
use arrow_array::RecordBatch;
pub use commit_message::CommitMessage;
pub use data_evolution_writer::DataEvolutionWriter;
#[cfg(feature = "fulltext")]
pub use full_text_search_builder::FullTextSearchBuilder;
use futures::stream::BoxStream;
pub use read_builder::ReadBuilder;
pub use rest_env::RESTEnv;
pub use schema_manager::SchemaManager;
pub use snapshot_commit::{RESTSnapshotCommit, RenamingSnapshotCommit, SnapshotCommit};
pub use snapshot_manager::SnapshotManager;
pub use source::{
merge_row_ranges, DataSplit, DataSplitBuilder, DeletionFile, PartitionBucket, Plan, RowRange,
};
pub use table_commit::TableCommit;
pub use table_read::TableRead;
pub use table_scan::TableScan;
pub use table_write::TableWrite;
pub use tag_manager::TagManager;
pub use write_builder::WriteBuilder;
use crate::catalog::Identifier;
use crate::io::FileIO;
use crate::spec::TableSchema;
use std::collections::HashMap;
#[derive(Debug, Clone)]
pub struct Table {
file_io: FileIO,
identifier: Identifier,
location: String,
schema: TableSchema,
schema_manager: SchemaManager,
rest_env: Option<RESTEnv>,
}
impl Table {
pub fn new(
file_io: FileIO,
identifier: Identifier,
location: String,
schema: TableSchema,
rest_env: Option<RESTEnv>,
) -> Self {
let schema_manager = SchemaManager::new(file_io.clone(), location.clone());
Self {
file_io,
identifier,
location,
schema,
schema_manager,
rest_env,
}
}
pub fn identifier(&self) -> &Identifier {
&self.identifier
}
pub fn location(&self) -> &str {
&self.location
}
pub fn schema(&self) -> &TableSchema {
&self.schema
}
pub fn file_io(&self) -> &FileIO {
&self.file_io
}
pub fn schema_manager(&self) -> &SchemaManager {
&self.schema_manager
}
pub fn new_read_builder(&self) -> ReadBuilder<'_> {
ReadBuilder::new(self)
}
#[cfg(feature = "fulltext")]
pub fn new_full_text_search_builder(&self) -> FullTextSearchBuilder<'_> {
FullTextSearchBuilder::new(self)
}
pub fn new_write_builder(&self) -> WriteBuilder<'_> {
WriteBuilder::new(self)
}
pub fn copy_with_options(&self, extra: HashMap<String, String>) -> Self {
Self {
file_io: self.file_io.clone(),
identifier: self.identifier.clone(),
location: self.location.clone(),
schema: self.schema.copy_with_options(extra),
schema_manager: self.schema_manager.clone(),
rest_env: self.rest_env.clone(),
}
}
}
pub type ArrowRecordBatchStream = BoxStream<'static, Result<RecordBatch>>;