@@ -407,69 +407,6 @@ mod tests {
407
407
Ok ( ( ) )
408
408
}
409
409
410
- #[ tokio:: test]
411
- async fn test_batch_spill_and_read_dictionary_arrays ( ) -> Result < ( ) > {
412
- // See https://github.com/apache/datafusion/issues/4658
413
-
414
- let batch1 = build_table_i32 (
415
- ( "a2" , & vec ! [ 0 , 1 , 2 ] ) ,
416
- ( "b2" , & vec ! [ 3 , 4 , 5 ] ) ,
417
- ( "c2" , & vec ! [ 4 , 5 , 6 ] ) ,
418
- ) ;
419
-
420
- let batch2 = build_table_i32 (
421
- ( "a2" , & vec ! [ 10 , 11 , 12 ] ) ,
422
- ( "b2" , & vec ! [ 13 , 14 , 15 ] ) ,
423
- ( "c2" , & vec ! [ 14 , 15 , 16 ] ) ,
424
- ) ;
425
-
426
- // Dictionary encode the arrays
427
- let dict_type =
428
- DataType :: Dictionary ( Box :: new ( DataType :: Int32 ) , Box :: new ( DataType :: Int32 ) ) ;
429
- let dict_schema = Arc :: new ( Schema :: new ( vec ! [
430
- Field :: new( "a2" , dict_type. clone( ) , true ) ,
431
- Field :: new( "b2" , dict_type. clone( ) , true ) ,
432
- Field :: new( "c2" , dict_type. clone( ) , true ) ,
433
- ] ) ) ;
434
-
435
- let batch1 = RecordBatch :: try_new (
436
- Arc :: clone ( & dict_schema) ,
437
- batch1
438
- . columns ( )
439
- . iter ( )
440
- . map ( |array| cast ( array, & dict_type) )
441
- . collect :: < Result < _ , _ > > ( ) ?,
442
- ) ?;
443
-
444
- let batch2 = RecordBatch :: try_new (
445
- Arc :: clone ( & dict_schema) ,
446
- batch2
447
- . columns ( )
448
- . iter ( )
449
- . map ( |array| cast ( array, & dict_type) )
450
- . collect :: < Result < _ , _ > > ( ) ?,
451
- ) ?;
452
-
453
- // Construct SpillManager
454
- let env = Arc :: new ( RuntimeEnv :: default ( ) ) ;
455
- let metrics = SpillMetrics :: new ( & ExecutionPlanMetricsSet :: new ( ) , 0 ) ;
456
- let spill_manager = SpillManager :: new ( env, metrics, Arc :: clone ( & dict_schema) ) ;
457
-
458
- let num_rows = batch1. num_rows ( ) + batch2. num_rows ( ) ;
459
- let spill_file = spill_manager
460
- . spill_record_batch_and_finish ( & [ batch1, batch2] , "Test" ) ?
461
- . unwrap ( ) ;
462
- let spilled_rows = spill_manager. metrics . spilled_rows . value ( ) ;
463
- assert_eq ! ( spilled_rows, num_rows) ;
464
-
465
- let stream = spill_manager. read_spill_as_stream ( spill_file) ?;
466
- assert_eq ! ( stream. schema( ) , dict_schema) ;
467
- let batches = collect ( stream) . await ?;
468
- assert_eq ! ( batches. len( ) , 2 ) ;
469
-
470
- Ok ( ( ) )
471
- }
472
-
473
410
#[ tokio:: test]
474
411
async fn test_batch_spill_by_size ( ) -> Result < ( ) > {
475
412
let batch1 = build_table_i32 (
0 commit comments