Skip to content

Commit 39a26ab

Browse files
committed
feat: return Err for unimplemented delete vec parse methods and make DeleteVector::intersect_assign pub(crate)
1 parent f65905c commit 39a26ab

File tree

3 files changed

+15
-8
lines changed

3 files changed

+15
-8
lines changed

crates/iceberg/src/arrow/delete_file_manager.rs

+13-6
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,10 @@ impl CachingDeleteFileManager {
359359
) -> Result<HashMap<String, DeleteVector>> {
360360
// TODO
361361

362-
Ok(HashMap::default())
362+
Err(Error::new(
363+
ErrorKind::FeatureUnsupported,
364+
"parsing of positional deletes is not yet supported",
365+
))
363366
}
364367

365368
/// Parses record batch streams from individual equality delete files
@@ -370,7 +373,10 @@ impl CachingDeleteFileManager {
370373
) -> Result<Predicate> {
371374
// TODO
372375

373-
Ok(AlwaysTrue)
376+
Err(Error::new(
377+
ErrorKind::FeatureUnsupported,
378+
"parsing of equality deletes is not yet supported",
379+
))
374380
}
375381

376382
/// Builds eq delete predicate for the provided task.
@@ -471,15 +477,16 @@ mod tests {
471477
.unwrap();
472478

473479
// Note that with the delete file parsing not yet in place, all we can test here is that
474-
// the call to the loader does not fail.
480+
// the call to the loader fails with the expected FeatureUnsupportedError.
475481
let delete_file_manager = CachingDeleteFileManager::new(file_io.clone(), 10);
476482

477483
let file_scan_tasks = setup(table_location);
478484

479-
delete_file_manager
485+
let result = delete_file_manager
480486
.load_deletes(&file_scan_tasks[0].deletes)
481-
.await
482-
.unwrap();
487+
.await;
488+
489+
assert!(result.is_err_and(|e| e.kind() == ErrorKind::FeatureUnsupported));
483490
}
484491

485492
fn setup(table_location: &Path) -> Vec<FileScanTask> {

crates/iceberg/src/arrow/reader.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ impl ArrowReader {
307307
if let Some(positional_delete_indexes) = positional_delete_indexes {
308308
let delete_row_selection = {
309309
let positional_delete_indexes = positional_delete_indexes.read().unwrap();
310-
310+
311311
Self::build_deletes_row_selection(
312312
record_batch_stream_builder.metadata().row_groups(),
313313
&selected_row_group_indices,

crates/iceberg/src/delete_vector.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ impl DeleteVector {
3939
DeleteVectorIterator { outer, inner: None }
4040
}
4141

42-
pub fn intersect_assign(&mut self, other: &DeleteVector) {
42+
pub(crate) fn intersect_assign(&mut self, other: &DeleteVector) {
4343
self.inner.bitor_assign(&other.inner);
4444
}
4545
}

0 commit comments

Comments
 (0)