-
Notifications
You must be signed in to change notification settings - Fork 31
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
feat(spec): Add Snapshot #11
Conversation
/// | ||
/// Impl Reference: <https://github.com/apache/paimon/blob/db8bcd7fdd9c2705435d2ab1d2341c52d1f67ee5/paimon-core/src/main/java/org/apache/paimon/Snapshot.java#L68>. | ||
#[derive(Debug, Clone, PartialEq, Eq, Deserialize, Serialize, TypedBuilder)] | ||
pub struct Snapshot { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we need serde(rename_all("camelCase"))
?
crates/paimon/src/spec/snapshot.rs
Outdated
delta_manifest_list: String, | ||
/// a manifest list recording all changelog produced in this snapshot | ||
#[builder(default = None)] | ||
change_log_manifest_list: Option<String>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be changelog_manifest_list
crates/paimon/src/spec/snapshot.rs
Outdated
delta_record_count: Option<i64>, | ||
/// record count of all changelog produced in this snapshot | ||
#[builder(default = None)] | ||
change_log_record_count: Option<i64>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be changelog_record_count
crates/paimon/src/spec/snapshot.rs
Outdated
} | ||
|
||
#[inline] | ||
pub fn change_log_manifest_list(&self) -> Option<&String> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Better to return Option<&str>
instead.
crates/paimon/src/spec/snapshot.rs
Outdated
} | ||
|
||
#[inline] | ||
pub fn commit_kind(&self) -> &CommitKind { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CommitKind
could be Copy
, we can return CommitKind
directly.
|
||
impl Snapshot { | ||
#[inline] | ||
pub fn version(&self) -> i32 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Better to provide APIs for our public API.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Better to provide APIs for our public API.
Do you mean remove #[inline]
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh sorry, I mean add API docs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh sorry, I mean add API docs.
I have updated it, PTAL 👀
crates/paimon/src/spec/snapshot.rs
Outdated
// specific language governing permissions and limitations | ||
// under the License. | ||
|
||
/*! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use //!
for mod docs.
crates/paimon/src/spec/snapshot.rs
Outdated
commit_identifier: i64, | ||
commit_kind: CommitKind, | ||
time_millis: i64, | ||
log_offsets: HashMap<i32, i64>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we don't need to add this field.
We don't write it, and we don't have requirement to read it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we don't need to add this field. We don't write it, and we don't have requirement to read it.
OK, I will remove it later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mostly LGTM, let's move!
cc @JingsongLi and @SteNicholas for another look. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
fix: #6
This PR will add
Snapshot
. Some function includeManifestList
is not implemented yet.