@@ -19,7 +19,7 @@ use std::any::Any;
19
19
use std:: fmt:: { Debug , Formatter } ;
20
20
use std:: sync:: Arc ;
21
21
22
- use datafusion:: arrow:: array:: { ArrayRef , RecordBatch , StringArray , UInt64Array } ;
22
+ use datafusion:: arrow:: array:: { ArrayRef , RecordBatch , StringArray , StructArray , UInt64Array } ;
23
23
use datafusion:: arrow:: datatypes:: {
24
24
DataType , Field , Schema as ArrowSchema , SchemaRef as ArrowSchemaRef ,
25
25
} ;
@@ -74,15 +74,14 @@ impl IcebergWriteExec {
74
74
}
75
75
76
76
// Create a record batch with count and serialized data files
77
- fn make_result_batch ( count : u64 , data_files : Vec < String > ) -> RecordBatch {
77
+ fn make_result_batch ( count : u64 , data_files : Vec < String > ) -> DFResult < RecordBatch > {
78
78
let count_array = Arc :: new ( UInt64Array :: from ( vec ! [ count] ) ) as ArrayRef ;
79
79
let files_array = Arc :: new ( StringArray :: from ( data_files) ) as ArrayRef ;
80
80
81
81
RecordBatch :: try_from_iter_with_nullable ( vec ! [
82
82
( "count" , count_array, false ) ,
83
83
( "data_files" , files_array, false ) ,
84
84
] )
85
- . unwrap ( )
86
85
}
87
86
88
87
fn make_result_schema ( ) -> ArrowSchemaRef {
@@ -199,7 +198,7 @@ impl ExecutionPlan for IcebergWriteExec {
199
198
} )
200
199
. collect :: < Vec < String > > ( ) ;
201
200
202
- Ok ( Self :: make_result_batch ( count, data_files) )
201
+ Ok ( Self :: make_result_batch ( count, data_files) ? )
203
202
} )
204
203
. boxed ( ) ;
205
204
0 commit comments