File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
native/core/src/execution/shuffle Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -983,23 +983,24 @@ impl ShufflePartitioner for SinglePartitionShufflePartitioner {
983983 self . output_data_writer . flush ( & self . metrics . write_time ) ?;
984984
985985 // Write index file. It should only contain 2 entries: 0 and the total number of bytes written
986- let mut index_file = OpenOptions :: new ( )
986+ let index_file = OpenOptions :: new ( )
987987 . write ( true )
988988 . create ( true )
989989 . truncate ( true )
990990 . open ( self . output_index_path . clone ( ) )
991991 . map_err ( |e| DataFusionError :: Execution ( format ! ( "shuffle write error: {e:?}" ) ) ) ?;
992+ let mut index_buf_writer = BufWriter :: new ( index_file) ;
992993 let data_file_length = self
993994 . output_data_writer
994995 . writer
995996 . stream_position ( )
996997 . map_err ( to_df_err) ?;
997998 for offset in [ 0 , data_file_length] {
998- index_file
999+ index_buf_writer
9991000 . write_all ( & ( offset as i64 ) . to_le_bytes ( ) [ ..] )
10001001 . map_err ( to_df_err) ?;
10011002 }
1002- index_file . flush ( ) ?;
1003+ index_buf_writer . flush ( ) ?;
10031004
10041005 self . metrics
10051006 . baseline
You can’t perform that action at this time.
0 commit comments