feat: replace f32,f64 with ordered_float #119
Merged
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.
simple solution for #116.
Why I introduce ordred_float diretly
I find that it's unapprpriate to implement this order in the custom float directly. If we implement -0 < 0 for the custom float, which means that
CustomFloat(-0) < CustomFloat(0)
will return true. Then what result ofCustomFloat(-0) == CustomFloat(0)
should return?:CustomFloat(-0) < CustomFloat(0)
I think this order is specific for the iceberg partition order. So this order rule should implement as a custom order trait or implement for AnyValue. E.g.
I find that this hash is specific for the bucket transform. https://iceberg.apache.org/spec/#appendix-b-32-bit-hash-requirements:~:text=For%20hash%20function%20details%20by%20type%2C%20see%20Appendix%20B. So we also can implemment as specific hash trait rather than general hash trait. E.g.