Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use f64::total_cmp instead of OrderedFloat #4051

Closed
tustvold opened this issue Nov 1, 2022 · 4 comments · Fixed by #4133
Closed

Use f64::total_cmp instead of OrderedFloat #4051

tustvold opened this issue Nov 1, 2022 · 4 comments · Fixed by #4133
Assignees
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@tustvold
Copy link
Contributor

tustvold commented Nov 1, 2022

Is your feature request related to a problem or challenge? Please describe what you are trying to do.

DataFusion uses OrderedFloat in various places to order floats, this is different from arrow-rs which makes use of https://doc.rust-lang.org/std/primitive.f32.html#method.total_cmp.

Describe the solution you'd like

Moving away from OrderedFloat will:

  • Ensure consistency
  • Eliminate a dependency

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

@alamb
Copy link
Contributor

alamb commented Nov 1, 2022

Sounds like a great idea -- thanks @tustvold

I think this would likely be a good first project for someone as there is existing test coverage and should "just" be a matter of changing around some APIs

@alamb alamb added the good first issue Good for newcomers label Nov 1, 2022
@comphead
Copy link
Contributor

comphead commented Nov 3, 2022

@tustvold please assign this to me

@comphead
Copy link
Contributor

comphead commented Nov 4, 2022

@tustvold Looks like OrderedFloat also implements Hash and Eq for floats.
Hash required for ScalarValue, Eq required for centroids. Do you want to make our own impl for Eq,Hash for f64?

@tustvold
Copy link
Contributor Author

tustvold commented Nov 4, 2022

I added a HashValue trait in hash_utils.rs we can likely use / make public

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants