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

Function test_distinct_on

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

Source from the content-addressed store, hash-verified

1393
1394#[tokio::test]
1395async fn test_distinct_on() -> Result<()> {
1396 let t = test_table().await?;
1397 let plan = t
1398 .distinct_on(vec![col("c1")], vec![col("aggregate_test_100.c1")], None)
1399 .unwrap();
1400
1401 let sql_plan =
1402 create_plan("select distinct on (c1) c1 from aggregate_test_100").await?;
1403
1404 assert_same_plan(&plan.logical_plan().clone(), &sql_plan);
1405
1406 let df_results = plan.clone().collect().await?;
1407
1408 assert_snapshot!(
1409 batches_to_sort_string(&df_results),
1410 @r"
1411 +----+
1412 | c1 |
1413 +----+
1414 | a |
1415 | b |
1416 | c |
1417 | d |
1418 | e |
1419 +----+
1420 "
1421 );
1422
1423 Ok(())
1424}
1425
1426#[tokio::test]
1427async fn test_distinct_on_sort_by() -> Result<()> {

Callers

nothing calls this directly

Calls 7

test_tableFunction · 0.85
assert_same_planFunction · 0.85
collectMethod · 0.80
create_planFunction · 0.70
distinct_onMethod · 0.45
cloneMethod · 0.45
logical_planMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…