Skip to content

Commit 5cbc7f8

Browse files
committed
expose position delete schema and genreate snapshot id
1 parent 8343ce5 commit 5cbc7f8

File tree

4 files changed

+10
-2
lines changed

4 files changed

+10
-2
lines changed

crates/iceberg/src/transaction/append.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ impl FastAppendAction {
6868
self
6969
}
7070

71+
/// Set target branch for the snapshot.
7172
pub fn set_target_branch(mut self, target_branch: String) -> Self {
7273
self.target_branch = Some(target_branch);
7374
self
@@ -106,6 +107,7 @@ impl FastAppendAction {
106107
self
107108
}
108109

110+
/// Set snapshot id for the snapshot.
109111
pub fn set_snapshot_id(mut self, snapshot_id: i64) -> Self {
110112
self.snapshot_id = Some(snapshot_id);
111113
self

crates/iceberg/src/transaction/mod.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@ mod action;
5454

5555
pub use action::*;
5656
mod append;
57+
58+
pub use append::FastAppendAction;
5759
mod manifest_filter;
5860

5961
pub use manifest_filter::*;
@@ -77,7 +79,7 @@ use rewrite_files::RewriteFilesAction;
7779
use crate::error::Result;
7880
use crate::spec::TableProperties;
7981
use crate::table::Table;
80-
use crate::transaction::append::{FastAppendAction, MergeAppendAction};
82+
use crate::transaction::append::MergeAppendAction;
8183
use crate::transaction::overwrite_files::OverwriteFilesAction;
8284
use crate::transaction::sort_order::ReplaceSortOrderAction;
8385
use crate::transaction::update_location::UpdateLocationAction;

crates/iceberg/src/transaction/snapshot.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -708,14 +708,17 @@ impl<'a> SnapshotProducer<'a> {
708708
Ok(ActionCommit::new(updates, requirements))
709709
}
710710

711+
/// Set the new data file sequence number for this snapshot
711712
pub fn set_new_data_file_sequence_number(&mut self, new_data_file_sequence_number: i64) {
712713
self.new_data_file_sequence_number = Some(new_data_file_sequence_number);
713714
}
714715

716+
/// Set the target branch for this snapshot
715717
pub fn set_target_branch(&mut self, target_branch: String) {
716718
self.target_branch = target_branch;
717719
}
718720

721+
/// Get the target branch for this snapshot
719722
pub fn target_branch(&self) -> &str {
720723
&self.target_branch
721724
}

crates/iceberg/src/writer/base_writer/position_delete_file_writer.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,8 @@ static DELETE_FILE_POS: Lazy<NestedFieldRef> = Lazy::new(|| {
5454
Type::Primitive(PrimitiveType::Long),
5555
))
5656
});
57-
static POSITION_DELETE_SCHEMA: Lazy<Schema> = Lazy::new(|| {
57+
/// Iceberg schema used for position delete files (file_path, pos).
58+
pub static POSITION_DELETE_SCHEMA: Lazy<Schema> = Lazy::new(|| {
5859
Schema::builder()
5960
.with_fields(vec![DELETE_FILE_PATH.clone(), DELETE_FILE_POS.clone()])
6061
.build()

0 commit comments

Comments
 (0)