Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions datafusion/core/tests/sql/aggregates/basic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -441,3 +441,36 @@ async fn count_distinct_dictionary_mixed_values() -> Result<()> {

Ok(())
}

#[tokio::test]
Comment thread
Mark1626 marked this conversation as resolved.
async fn count_distinct_multiple_exprs() -> Result<()> {
let results =
execute_with_partition("SELECT count(distinct c1, c2) FROM test", 4).await?;
assert_snapshot!(batches_to_sort_string(&results), @r"
+---------------------------------+
| count(DISTINCT test.c1,test.c2) |
+---------------------------------+
| 40 |
+---------------------------------+
");
Ok(())
}

#[tokio::test]
async fn count_distinct_multiple_exprs_with_groups() -> Result<()> {
let results = execute_with_partition(
"SELECT c3, count(distinct c1, c2) FROM test GROUP BY c3",
4,
)
.await?;
assert_snapshot!(batches_to_sort_string(&results), @r"
+-------+---------------------------------+
| c3 | count(DISTINCT test.c1,test.c2) |
+-------+---------------------------------+
| false | 20 |
| true | 20 |
+-------+---------------------------------+
");

Ok(())
}
Loading
Loading