Skip to content

Commit d1c610d

Browse files
committed
fix(scan): keep the delete file size required in the builder
1 parent 514ee83 commit d1c610d

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

‎crates/iceberg/src/arrow/caching_delete_file_loader.rs‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -850,6 +850,7 @@ mod tests {
850850
fn test_delete_file_without_size_round_trips_through_serde() {
851851
let task = FileScanTaskDeleteFile::builder()
852852
.with_file_path("pos-del.parquet".to_string())
853+
.with_file_size_in_bytes_opt(None)
853854
.with_file_type(DataContentType::PositionDeletes)
854855
.with_file_format(DataFileFormat::Parquet)
855856
.with_partition_spec_id(0)
@@ -1247,6 +1248,7 @@ mod tests {
12471248
fn without_size(delete: &FileScanTaskDeleteFile, path: &str) -> FileScanTaskDeleteFile {
12481249
FileScanTaskDeleteFile::builder()
12491250
.with_file_path(path.to_string())
1251+
.with_file_size_in_bytes_opt(None)
12501252
.with_file_type(delete.file_type())
12511253
.with_file_format(delete.file_format())
12521254
.with_partition_spec_id(delete.partition_spec_id())

‎crates/iceberg/src/scan/task.rs‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -367,15 +367,15 @@ pub struct FileScanTaskDeleteFile {
367367
file_path: String,
368368

369369
/// The total size of the delete file in bytes. Tasks planned from manifest entries carry
370-
/// the recorded size. An externally constructed task may leave it unset when the size is
370+
/// the recorded size. An externally constructed task may pass `None` when the size is
371371
/// unavailable or the recorded size can't be trusted, such as position delete files
372372
/// rewritten by `rewrite_table_path` before Iceberg Java 1.12.0
373373
/// (<https://github.com/apache/iceberg/issues/12554>). The Parquet delete-file loader then
374374
/// resolves it with one metadata request when the file is first loaded. Deletion vectors
375375
/// do not use it.
376376
#[serde(default)]
377377
#[serde(skip_serializing_if = "Option::is_none")]
378-
#[builder(default, setter(strip_option(fallback = with_file_size_in_bytes_opt)))]
378+
#[builder(setter(strip_option(fallback = with_file_size_in_bytes_opt)))]
379379
file_size_in_bytes: Option<u64>,
380380

381381
/// delete file type

0 commit comments

Comments
 (0)