File tree 2 files changed +28
-4
lines changed
2 files changed +28
-4
lines changed Original file line number Diff line number Diff line change @@ -167,6 +167,14 @@ impl ArrowReader {
167
167
row_group_filtering_enabled : bool ,
168
168
row_selection_enabled : bool ,
169
169
) -> Result < ArrowRecordBatchStream > {
170
+ // TODO: add support for delete files
171
+ if !task. deletes . is_empty ( ) {
172
+ return Err ( Error :: new (
173
+ ErrorKind :: FeatureUnsupported ,
174
+ "Delete files are not yet supported" ,
175
+ ) ) ;
176
+ }
177
+
170
178
// Get the metadata for the Parquet file we need to read and build
171
179
// a reader for the data within
172
180
let parquet_file = file_io. new_input ( & task. data_file_path ) ?;
Original file line number Diff line number Diff line change 17
17
18
18
//! Integration tests for rest catalog.
19
19
20
+ use futures:: TryStreamExt ;
20
21
use iceberg:: ErrorKind :: FeatureUnsupported ;
21
22
use iceberg:: { Catalog , TableIdent } ;
22
23
use iceberg_integration_tests:: set_test_fixture;
@@ -35,16 +36,31 @@ async fn test_read_table_with_positional_deletes() {
35
36
. await
36
37
. unwrap ( ) ;
37
38
38
- let scan = table. scan ( ) . build ( ) . unwrap ( ) ;
39
+ let scan = table
40
+ . scan ( )
41
+ . with_delete_file_processing_enabled ( true )
42
+ . build ( )
43
+ . unwrap ( ) ;
39
44
println ! ( "{:?}" , scan) ;
40
45
41
- assert ! ( scan
42
- . to_arrow( )
46
+ let plan: Vec < _ > = scan
47
+ . plan_files ( )
48
+ . await
49
+ . unwrap ( )
50
+ . try_collect ( )
43
51
. await
44
- . is_err_and( |e| e. kind( ) == FeatureUnsupported ) ) ;
52
+ . unwrap ( ) ;
53
+ println ! ( "{:?}" , plan) ;
54
+
55
+ // Scan plan phase should include delete files in file plan
56
+ // when with_delete_file_processing_enabled == true
57
+ assert_eq ! ( plan[ 0 ] . deletes. len( ) , 2 ) ;
45
58
46
59
// 😱 If we don't support positional deletes, we should fail when we try to read a table that
47
60
// has positional deletes. The table has 12 rows, and 2 are deleted, see provision.py
61
+ let result = scan. to_arrow ( ) . await . unwrap ( ) . try_collect :: < Vec < _ > > ( ) . await ;
62
+
63
+ assert ! ( result. is_err_and( |e| e. kind( ) == FeatureUnsupported ) ) ;
48
64
49
65
// When we get support for it:
50
66
// let batch_stream = scan.to_arrow().await.unwrap();
You can’t perform that action at this time.
0 commit comments