Skip to content

Commit 5bac728

Browse files
author
zeb
committed
remove test
1 parent 0aeb290 commit 5bac728

File tree

1 file changed

+0
-63
lines changed
  • datafusion/physical-plan/src/spill

1 file changed

+0
-63
lines changed

datafusion/physical-plan/src/spill/mod.rs

Lines changed: 0 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -407,69 +407,6 @@ mod tests {
407407
Ok(())
408408
}
409409

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-
473410
#[tokio::test]
474411
async fn test_batch_spill_by_size() -> Result<()> {
475412
let batch1 = build_table_i32(

0 commit comments

Comments
 (0)