#![warn(missing_docs)]
use std::fmt;
pub mod bounds;
pub mod contract;
#[cfg(feature = "head")]
pub mod head;
pub mod version;
pub use contract::{Chunk, Contract, TableOptions, format_duration, parse_duration};
pub use version::FormatVersion;
pub mod property {
pub const TIME_COLUMN: &str = "timelake.time-column";
pub const SERIES_KEY: &str = "timelake.series-key";
pub const CHUNK: &str = "timelake.chunk-interval";
pub const DEDUP: &str = "timelake.dedup";
pub const RETENTION: &str = "timelake.retention";
pub const TARGET_FILE_SIZE: &str = "timelake.target-file-size-bytes";
pub const ROW_GROUP_ROWS: &str = "timelake.row-group-rows";
pub const AUTO_MAINTAIN: &str = "timelake.auto-maintain";
pub const SNAPSHOT_RETENTION: &str = "timelake.snapshot-retention";
pub const MIN_SNAPSHOTS: &str = "timelake.min-snapshots";
pub const MAX_SNAPSHOTS: &str = "timelake.max-snapshots";
pub const COMPACT_MIN_FILES: &str = "timelake.compact-min-files";
pub const HEAD_FORMAT: &str = "timelake.head-format";
pub const HEAD_INLINE_BYTES: &str = "timelake.head-inline-bytes";
pub const KEEP_SNAPSHOTS_UNTIL: &str = "timelake.keep-snapshots-until";
pub const FORMAT_VERSION: &str = "timelake.format-version";
}
pub mod summary {
pub const LAST_VALUE_INDEX: &str = "timelake.last-value-index";
pub const BATCH_ID: &str = "timelake.batch-id";
pub const ADDED_DATA_FILES: &str = "added-data-files";
pub const ADDED_RECORDS: &str = "added-records";
pub const ADDED_FILES_SIZE: &str = "added-files-size";
pub const DELETED_DATA_FILES: &str = "deleted-data-files";
pub const DELETED_RECORDS: &str = "deleted-records";
pub const REMOVED_FILES_SIZE: &str = "removed-files-size";
pub const TOTAL_DATA_FILES: &str = "total-data-files";
pub const TOTAL_RECORDS: &str = "total-records";
pub const TOTAL_FILES_SIZE: &str = "total-files-size";
pub const TOTAL_DELETE_FILES: &str = "total-delete-files";
pub const TOTAL_POSITION_DELETES: &str = "total-position-deletes";
pub const TOTAL_EQUALITY_DELETES: &str = "total-equality-deletes";
}
pub const FORMAT_VERSION: FormatVersion = FormatVersion::new(0, 2, 0);
pub const TABLES_INDEX: &str = "timelake-tables.json";
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct FormatError(pub String);
impl FormatError {
fn new(msg: impl Into<String>) -> Self {
Self(msg.into())
}
}
impl fmt::Display for FormatError {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str(&self.0)
}
}
impl std::error::Error for FormatError {}
pub type Result<T> = std::result::Result<T, FormatError>;