MCPcopy Create free account
hub / github.com/ceramicnetwork/rust-ceramic / test_insert_from_empty_table

Function test_insert_from_empty_table

pipeline/src/cache_table.rs:670–689  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

668
669 #[tokio::test]
670 async fn test_insert_from_empty_table() -> Result<()> {
671 // Create a new schema with one field called "a" of type Int32
672 let schema = Arc::new(Schema::new(vec![Field::new("a", DataType::Int32, false)]));
673
674 // Create a new batch of data to insert into the table
675 let batch = RecordBatch::try_new(
676 schema.clone(),
677 vec![Arc::new(Int32Array::from(vec![1, 2, 3]))],
678 )?;
679 // Run the experiment and obtain the resulting data in the table
680 let resulting_data_in_table = experiment(
681 schema,
682 vec![vec![batch.clone(), batch.clone()]],
683 vec![vec![]],
684 )
685 .await?;
686 // Ensure that the table now contains two batches of data in the same partition
687 assert_eq!(resulting_data_in_table[0].len(), 2);
688 Ok(())
689 }
690}

Callers

nothing calls this directly

Calls 3

newFunction · 0.85
experimentFunction · 0.85
cloneMethod · 0.45

Tested by

no test coverage detected