Skip to content

Conversation

@rluvaton
Copy link
Member

@rluvaton rluvaton commented Oct 8, 2025

Which issue does this PR close?

N/A

Rationale for this change

the benchmark did not test what it expected (I think), i.e. u64_wide was the same in every batch.

I run this query for the data:

SELECT
    COUNT(*) AS total_count,
    COUNT(DISTINCT u64_wide) AS unique_count,
    COUNT(DISTINCT u64_wide) * 1.0 / COUNT(*) AS cardinality
FROM t;

Before:

| total_count | unique_count | cardinality |
| ----------- | ------------ | ----------- |
|    65536    |    2048      |   0.03125   |

After:

| total_count | unique_count | cardinality |
| ----------- | ------------ | ----------- |
|    65536    |    65536     |     1.0     |

What changes are included in this PR?

  1. used the batch random when generating u64_wide
  2. added 2 more benchmarks for testing pure grouping performance for more than 1 column.
    i. u64_wide and utf8
    ii. u64_wide and f32

Are these changes tested?

No need

Are there any user-facing changes?

Nope

also added benchmark for testing pure grouping performance for more than 1 column.

----

I run this query for the data:
```
SELECT
    COUNT(*) AS total_count,
    COUNT(DISTINCT u64_wide) AS unique_count,
    COUNT(DISTINCT u64_wide) * 1.0 / COUNT(*) AS cardinality
FROM t;
```

Before:
```
| total_count | unique_count | cardinality |
| ----------- | ------------ | ----------- |
|    65536    |    2048      |   0.03125   |
```

After:
```
| total_count | unique_count | cardinality |
| ----------- | ------------ | ----------- |
|    65536    |    65536     |     1.0     |
```
@github-actions github-actions bot added the core Core DataFusion crate label Oct 8, 2025
@rluvaton rluvaton changed the title fix: actually generate a lot of unique values in benchmark table bench: fix actually generate a lot of unique values in benchmark table Oct 8, 2025
Copy link
Contributor

@alamb alamb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

makes sense to me -- thank you @rluvaton

@rluvaton rluvaton added this pull request to the merge queue Oct 9, 2025
Merged via the queue into apache:main with commit a497074 Oct 9, 2025
30 checks passed
@rluvaton rluvaton deleted the fix-benchmark-value-generation branch October 9, 2025 20:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core Core DataFusion crate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants