Skip to content

feat: add field min, max, bucket, level for ManifestFileMeta #83

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 53 additions & 0 deletions crates/paimon/src/spec/manifest_file_meta.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,18 @@ pub struct ManifestFileMeta {
/// schema id when writing this manifest file.
#[serde(rename = "_SCHEMA_ID")]
schema_id: i64,

#[serde(rename = "_MIN_BUCKET", skip_serializing_if = "Option::is_none")]
min_bucket: Option<i32>,

#[serde(rename = "_MAX_BUCKET", skip_serializing_if = "Option::is_none")]
max_bucket: Option<i32>,

#[serde(rename = "_MIN_LEVEL", skip_serializing_if = "Option::is_none")]
min_level: Option<i32>,

#[serde(rename = "_MAX_LEVEL", skip_serializing_if = "Option::is_none")]
max_level: Option<i32>,
}

impl ManifestFileMeta {
Expand Down Expand Up @@ -94,6 +106,43 @@ impl ManifestFileMeta {
self.version
}

#[inline]
pub fn min_bucket(&self) -> Option<i32> {
self.min_bucket
}

#[inline]
pub fn max_bucket(&self) -> Option<i32> {
self.max_bucket
}
#[inline]
pub fn min_level(&self) -> Option<i32> {
self.min_level
}
#[inline]
pub fn max_level(&self) -> Option<i32> {
self.max_level
}
pub fn with_min_bucket(mut self, min_bucket: Option<i32>) -> Self {
self.min_bucket = min_bucket;
self
}

pub fn with_max_bucket(mut self, max_bucket: Option<i32>) -> Self {
self.max_bucket = max_bucket;
self
}

pub fn with_min_level(mut self, min_level: Option<i32>) -> Self {
self.min_level = min_level;
self
}

pub fn with_max_level(mut self, max_level: Option<i32>) -> Self {
self.max_level = max_level;
self
}

#[inline]
pub fn new(
file_name: String,
Expand All @@ -111,6 +160,10 @@ impl ManifestFileMeta {
num_deleted_files,
partition_stats,
schema_id,
min_bucket: None,
max_bucket: None,
min_level: None,
max_level: None,
}
}
}
Expand Down
Loading