()
| 6484 | |
| 6485 | #[tokio::test] |
| 6486 | async fn test_fill_null_all_columns() -> Result<()> { |
| 6487 | let df = create_null_table().await?; |
| 6488 | |
| 6489 | // Use fill_null to replace nulls on all columns. |
| 6490 | // Only column "b" will be replaced since ScalarValue::Utf8(Some("default".to_string())) |
| 6491 | // can be cast to Utf8. |
| 6492 | let df_filled = |
| 6493 | df.fill_null(ScalarValue::Utf8(Some("default".to_string())), vec![])?; |
| 6494 | |
| 6495 | let results = df_filled.clone().collect().await?; |
| 6496 | |
| 6497 | assert_snapshot!( |
| 6498 | batches_to_sort_string(&results), |
| 6499 | @r" |
| 6500 | +---+---------+ |
| 6501 | | a | b | |
| 6502 | +---+---------+ |
| 6503 | | | default | |
| 6504 | | 1 | x | |
| 6505 | | 3 | z | |
| 6506 | +---+---------+ |
| 6507 | " |
| 6508 | ); |
| 6509 | |
| 6510 | // Fill column "a" null values with a value that cannot be cast to Int32. |
| 6511 | let df_filled = df_filled.fill_null(ScalarValue::Int32(Some(0)), vec![])?; |
| 6512 | |
| 6513 | let results = df_filled.collect().await?; |
| 6514 | assert_snapshot!( |
| 6515 | batches_to_sort_string(&results), |
| 6516 | @r" |
| 6517 | +---+---------+ |
| 6518 | | a | b | |
| 6519 | +---+---------+ |
| 6520 | | 0 | default | |
| 6521 | | 1 | x | |
| 6522 | | 3 | z | |
| 6523 | +---+---------+ |
| 6524 | " |
| 6525 | ); |
| 6526 | Ok(()) |
| 6527 | } |
| 6528 | |
| 6529 | #[tokio::test] |
| 6530 | async fn test_insert_into_casting_support() -> Result<()> { |
nothing calls this directly
no test coverage detected
searching dependent graphs…