File tree Expand file tree Collapse file tree 1 file changed +2
-4
lines changed Expand file tree Collapse file tree 1 file changed +2
-4
lines changed Original file line number Diff line number Diff line change @@ -261,17 +261,15 @@ fn remap_dictionary_key_nulls(
261261) -> DataFusionResult < DictionaryArray < Int64Type > > {
262262 let mut new_keys_builder = PrimitiveBuilder :: < Int64Type > :: new ( ) ;
263263 let mut value_indices_builder = PrimitiveBuilder :: < Int64Type > :: new ( ) ;
264- let mut value_map = HashMap :: new ( ) ; // Map old indices to new indices
265- let mut next_index = 0i64 ;
264+ let mut value_map: HashMap < i64 , i64 > = HashMap :: new ( ) ; // Map old indices to new indices
266265
267266 // First pass: build mapping of old indices to new indices
268267 for key in keys. iter ( ) {
269268 if let Some ( k) = key {
270269 let k_usize = k. as_usize ( ) ;
271270 if !values. is_null ( k_usize) && !value_map. contains_key ( & k) {
272- value_map. insert ( k, next_index ) ;
271+ value_map. insert ( k, i64 :: try_from ( value_map . len ( ) ) . expect ( "value_map overflow" ) ) ;
273272 value_indices_builder. append_value ( k) ;
274- next_index += 1 ;
275273 }
276274 }
277275 }
You can’t perform that action at this time.
0 commit comments