Count distinct floats#252
Merged
Dandandan merged 4 commits intoapache:masterfrom May 4, 2021
pjmore:count-distinct-floats
Merged
Count distinct floats#252Dandandan merged 4 commits intoapache:masterfrom pjmore:count-distinct-floats
Dandandan merged 4 commits intoapache:masterfrom
pjmore:count-distinct-floats
Conversation
Codecov Report
@@ Coverage Diff @@
## master #252 +/- ##
=======================================
Coverage 76.80% 76.81%
=======================================
Files 133 133
Lines 23284 23294 +10
=======================================
+ Hits 17884 17894 +10
Misses 5400 5400
Continue to review full report at Codecov.
|
returnString
approved these changes
May 4, 2021
alamb
approved these changes
May 4, 2021
Contributor
alamb
left a comment
There was a problem hiding this comment.
I tried it out locally and it works great. Thank you @pjmore !
alamb@ip-10-0-0-124:~/Software/arrow-datafusion$ echo "foo,1.23" > /tmp/foo.csv
alamb@ip-10-0-0-124:~/Software/arrow-datafusion$ cargo run -p datafusion-cli
Finished dev [unoptimized + debuginfo] target(s) in 0.13s
Running `target/debug/datafusion-cli`
> CREATE EXTERNAL TABLE t (a varchar, b float) STORED AS CSV LOCATION '/tmp/foo.csv';
0 rows in set. Query took 0 seconds.
> select count(distinct a) from t;
+-------------------+
| COUNT(DISTINCT a) |
+-------------------+
| 1 |
+-------------------+
1 rows in set. Query took 0 seconds.
> select count(distinct b) from t;
+-------------------+
| COUNT(DISTINCT b) |
+-------------------+
| 1 |
+-------------------+
1 rows in set. Query took 0 seconds.
Contributor
|
Thanks again @pjmore ! |
Contributor
|
🎉 |
unkloud
pushed a commit
to unkloud/datafusion
that referenced
this pull request
Mar 23, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Which issue does this PR close?
Closes #199 .
What changes are included in this PR?
Modified try_from_array method on ScalarValue and added tests to physical_plan/distinct_expressions.rs
The tests cover all of the floating point weirdness that I could think of, namely NaN, the infinities, and subnormal numbers, but if I missed any I'm happy to add tests for them.
Are there any user-facing changes?
No