You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by "dentiny (via GitHub)" <gi...@apache.org> on 2025/07/21 01:04:22 UTC
[PR] feat: append action allows snapshot properties [iceberg-rust]
dentiny opened a new pull request, #1534:
URL: https://github.com/apache/iceberg-rust/pull/1534
## Which issue does this PR close?
- Closes https://github.com/apache/iceberg-rust/issues/1533
## What changes are included in this PR?
I have a real-world production requirement: I need the capability to add snapshot properties to a new snapshot, whether or not there's new data files appended at the same time.
In this PR, I tried to reuse the `FastAppend` interface, which allows people only added properties but not data files.
## Are these changes tested?
Unit tested added.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] feat: append action allows snapshot properties [iceberg-rust]
Posted by "liurenjie1024 (via GitHub)" <gi...@apache.org>.
liurenjie1024 commented on code in PR #1534:
URL: https://github.com/apache/iceberg-rust/pull/1534#discussion_r2225104905
##########
crates/iceberg/src/transaction/snapshot.rs:
##########
@@ -251,12 +251,7 @@ impl<'a> SnapshotProducer<'a> {
// Write manifest file for added data files and return the ManifestFile for ManifestList.
async fn write_added_manifest(&mut self) -> Result<ManifestFile> {
let added_data_files = std::mem::take(&mut self.added_data_files);
- if added_data_files.is_empty() {
- return Err(Error::new(
- ErrorKind::PreconditionFailed,
- "No added data files found when write a manifest file",
- ));
- }
+ assert!(!added_data_files.is_empty());
Review Comment:
I'm not a big fan of using assert here, I would prefer to return `Err` here. If you insist on using assersation, I would suggest to use `debug_assert`.
##########
crates/iceberg/src/transaction/snapshot.rs:
##########
@@ -284,13 +279,26 @@ impl<'a> SnapshotProducer<'a> {
snapshot_produce_operation: &OP,
manifest_process: &MP,
) -> Result<Vec<ManifestFile>> {
- let added_manifest = self.write_added_manifest().await?;
+ // Assert current snapshot producer contains new content to add to new snapshot.
+ if self.added_data_files.is_empty() && self.snapshot_properties.is_empty() {
Review Comment:
Please create an issue to track that we need to remove this workaround when we introduced all necessary tx apis.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] feat: append action allows snapshot properties [iceberg-rust]
Posted by "liurenjie1024 (via GitHub)" <gi...@apache.org>.
liurenjie1024 merged PR #1534:
URL: https://github.com/apache/iceberg-rust/pull/1534
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] feat: append action allows snapshot properties [iceberg-rust]
Posted by "dentiny (via GitHub)" <gi...@apache.org>.
dentiny commented on code in PR #1534:
URL: https://github.com/apache/iceberg-rust/pull/1534#discussion_r2225160582
##########
crates/iceberg/src/transaction/snapshot.rs:
##########
@@ -284,13 +279,26 @@ impl<'a> SnapshotProducer<'a> {
snapshot_produce_operation: &OP,
manifest_process: &MP,
) -> Result<Vec<ManifestFile>> {
- let added_manifest = self.write_added_manifest().await?;
+ // Assert current snapshot producer contains new content to add to new snapshot.
+ if self.added_data_files.is_empty() && self.snapshot_properties.is_empty() {
Review Comment:
Sure! I created an issue to track: https://github.com/apache/iceberg-rust/issues/1548
Also leave TODO items in the code along with the issue attached.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] feat: append action allows snapshot properties [iceberg-rust]
Posted by "dentiny (via GitHub)" <gi...@apache.org>.
dentiny commented on code in PR #1534:
URL: https://github.com/apache/iceberg-rust/pull/1534#discussion_r2225158688
##########
crates/iceberg/src/transaction/snapshot.rs:
##########
@@ -251,12 +251,7 @@ impl<'a> SnapshotProducer<'a> {
// Write manifest file for added data files and return the ManifestFile for ManifestList.
async fn write_added_manifest(&mut self) -> Result<ManifestFile> {
let added_data_files = std::mem::take(&mut self.added_data_files);
- if added_data_files.is_empty() {
- return Err(Error::new(
- ErrorKind::PreconditionFailed,
- "No added data files found when write a manifest file",
- ));
- }
+ assert!(!added_data_files.is_empty());
Review Comment:
sure, I updated to error status returned; I was using assertion initially because `added_data_files` has been checked at caller side and I think it's a sanity check.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org