MCPcopy Create free account
hub / github.com/apache/datafusion / create_null_table

Function create_null_table

datafusion/core/tests/dataframe/mod.rs:6429–6454  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

6427}
6428
6429async fn create_null_table() -> Result<DataFrame> {
6430 // create a DataFrame with null values
6431 // "+---+----+",
6432 // "| a | b |",
6433 // "+---+---+",
6434 // "| 1 | x |",
6435 // "| | |",
6436 // "| 3 | z |",
6437 // "+---+---+",
6438 let schema = Arc::new(Schema::new(vec![
6439 Field::new("a", DataType::Int32, true),
6440 Field::new("b", DataType::Utf8, true),
6441 ]));
6442 let a_values = Int32Array::from(vec![Some(1), None, Some(3)]);
6443 let b_values = StringArray::from(vec![Some("x"), None, Some("z")]);
6444 let batch = RecordBatch::try_new(
6445 schema.clone(),
6446 vec![Arc::new(a_values), Arc::new(b_values)],
6447 )?;
6448
6449 let ctx = SessionContext::new();
6450 let table = MemTable::try_new(schema.clone(), vec![vec![batch]])?;
6451 ctx.register_table("t_null", Arc::new(table))?;
6452 let df = ctx.table("t_null").await?;
6453 Ok(df)
6454}
6455
6456#[tokio::test]
6457async fn test_fill_null() -> Result<()> {

Callers 2

test_fill_nullFunction · 0.85

Calls 4

newFunction · 0.85
cloneMethod · 0.45
register_tableMethod · 0.45
tableMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…