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

Common: BigDecimal instead of Float for numeric EnrichedEvent fields #654

Closed
istreeter opened this issue Jul 21, 2022 · 0 comments
Closed
Labels
bug Something isn't working

Comments

@istreeter
Copy link
Contributor

Starting from Enrich version 3, we changed certain fields of EnrichedEvent from a String to a Float. It was part of the feature where we started validating that events conform to the atomic event iglu schema, see #517

The affected fields were:

  • se_value
  • tr_total
  • tr_tax
  • tr_shipping
  • ti_price
  • tr_total_base
  • tr_tax_base
  • tr_shipping_base
  • ti_price_base

But, Float is not the best representation of these fields because of rounding errors. For example, if the incoming event has string value 137777104559 then it gets rounded to 137777104000 when converting to a Float.

Instead, we should handle these fields as BigDecimals

@istreeter istreeter added the bug Something isn't working label Jul 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant