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

fix(611): SortIndex handles BigDecimal in wrong way #612

Merged
merged 1 commit into from
Jun 18, 2024

Conversation

novoj
Copy link
Collaborator

@novoj novoj commented Jun 18, 2024

SortIndex internally holds Map, where key is the indexed value and value is the cardinality of the key. There is a normalizer implementation for certain types of keys (localized strings), but not for BigDecimal. But when the indexed values are BigDecimals and come in different forms - like 0 and 0.000 - they don't match in the map lookup unless normalized by stripTrailingZeros(). This causes the sort index to break during indexing.

SortIndex internally holds Map, where key is the indexed value and value is the cardinality of the key. There is a normalizer implementation for certain types of keys (localized strings), but not for BigDecimal. But when the indexed values are BigDecimals and come in different forms - like `0` and `0.000` - they don't match in the map lookup unless normalized by `stripTrailingZeros()`. This causes the sort index to break during indexing.
@novoj novoj merged commit 4633e75 into master Jun 18, 2024
@novoj novoj deleted the 611-sortindex-handles-bigdecimal-in-wrong-way branch June 18, 2024 12:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant