pub struct SegmentMeta {
pub segment_id: SegmentId,
pub path: String,
pub format: FileFormat,
pub ts_min: DateTime<Utc>,
pub ts_max: DateTime<Utc>,
pub row_count: u64,
pub file_size: Option<u64>,
pub coverage_path: Option<String>,
}Expand description
Metadata about a single physical segment.
In v0.1, a “segment” corresponds to a single data file on disk.
Fields§
§segment_id: SegmentIdLogical identifier for this segment.
path: StringFile path relative to the table root (for example, "data/nvda_1h_0001.parquet").
format: FileFormatFile format for this segment.
ts_min: DateTime<Utc>Minimum timestamp contained in this segment (inclusive), in RFC3339 UTC.
ts_max: DateTime<Utc>Maximum timestamp contained in this segment (inclusive), in RFC3339 UTC.
row_count: u64Number of rows in this segment.
file_size: Option<u64>Optional file size in bytes at the time metadata was captured.
coverage_path: Option<String>Coverage sidecar pointer.
Implementations§
Source§impl SegmentMeta
impl SegmentMeta
Sourcepub fn with_coverage_path(self, path: impl Into<String>) -> Self
pub fn with_coverage_path(self, path: impl Into<String>) -> Self
Set the coverage sidecar path for this segment metadata.
Source§impl SegmentMeta
impl SegmentMeta
Sourcepub async fn for_parquet(
location: &TableLocation,
segment_id: SegmentId,
path: &str,
ts_min: DateTime<Utc>,
ts_max: DateTime<Utc>,
row_count: u64,
) -> SegmentResult<Self>
pub async fn for_parquet( location: &TableLocation, segment_id: SegmentId, path: &str, ts_min: DateTime<Utc>, ts_max: DateTime<Utc>, row_count: u64, ) -> SegmentResult<Self>
Construct a validated Parquet SegmentMeta for a file.
locationdescribes where the table lives (e.g. local root).pathis the logical path stored in the log (e.g. “data/seg1.parquet” or an absolute path).
This is a v0.1 local-filesystem helper: it relies on storage::read_head_tail_4
which currently only supports TableLocation::Local.
Sourcepub async fn new_validated(
location: &TableLocation,
segment_id: SegmentId,
path: &str,
format: FileFormat,
ts_min: DateTime<Utc>,
ts_max: DateTime<Utc>,
row_count: u64,
) -> SegmentResult<Self>
pub async fn new_validated( location: &TableLocation, segment_id: SegmentId, path: &str, format: FileFormat, ts_min: DateTime<Utc>, ts_max: DateTime<Utc>, row_count: u64, ) -> SegmentResult<Self>
Format-dispatching constructor that can grow in future versions.
v0.1: only FileFormat::Parquet is supported and validated via
for_parquet.
Trait Implementations§
Source§impl Clone for SegmentMeta
impl Clone for SegmentMeta
Source§fn clone(&self) -> SegmentMeta
fn clone(&self) -> SegmentMeta
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SegmentMeta
impl Debug for SegmentMeta
Source§impl<'de> Deserialize<'de> for SegmentMeta
impl<'de> Deserialize<'de> for SegmentMeta
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for SegmentMeta
impl PartialEq for SegmentMeta
Source§impl Serialize for SegmentMeta
impl Serialize for SegmentMeta
impl Eq for SegmentMeta
impl StructuralPartialEq for SegmentMeta
Auto Trait Implementations§
impl Freeze for SegmentMeta
impl RefUnwindSafe for SegmentMeta
impl Send for SegmentMeta
impl Sync for SegmentMeta
impl Unpin for SegmentMeta
impl UnsafeUnpin for SegmentMeta
impl UnwindSafe for SegmentMeta
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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