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

[BUG] DynamoDB source export converts Numbers ending in 0 to scientific notation #3840

Open
graytaylor0 opened this issue Dec 8, 2023 · 4 comments
Assignees
Labels
bug Something isn't working Priority-High

Comments

@graytaylor0
Copy link
Member

graytaylor0 commented Dec 8, 2023

Describe the bug
Given an item in with a Number type ending in 0, such as 1702062202420, the DynamoDB source will convert it to scientific notation for export items.

{"pk": "my_partition_key", "sk":"my_sort_key", "my_number_ending_in_0": 702062202420 }

To Reproduce
Steps to reproduce the behavior:

  1. Create a pipeline with a dynamodb source with export and an opensearch
  2. Once the export is complete, the document will be sent to the OpenSearch sink as the following with the my_number_ending_in_0 key converted to scientific notation
{"pk": "my_partition_key", "sk":"my_sort_key", "my_number_ending_in_0": 1.70206220242E+12 }

Expected behavior
The Numbers ending in 0 should not be manipulated and the above example should result in

{"pk": "my_partition_key", "sk":"my_sort_key", "my_number_ending_in_0": 702062202420 }

Additional context
The conversion only happens for export values when converting from the ion line here (

), but Data Prepper JacksonEvent also converts to scientific notation when converting to json string ( ). I initially had created a custom deserializer that iterated over and converted all decimals of this format to not use scientific notation, however this may not be the best approach

@graytaylor0 graytaylor0 added bug Something isn't working untriaged labels Dec 8, 2023
@dlvenable dlvenable added this to the v2.6.2 milestone Dec 8, 2023
@graytaylor0 graytaylor0 removed their assignment Jan 16, 2024
@dlvenable dlvenable modified the milestones: v2.6.2, v2.7 Jan 17, 2024
@dlvenable dlvenable modified the milestones: v2.7, v2.8 Jan 30, 2024
@dlvenable dlvenable modified the milestones: v2.8, v2.9 May 16, 2024
@san81
Copy link
Contributor

san81 commented May 21, 2024

I can work this

@san81
Copy link
Contributor

san81 commented Jul 29, 2024

As part of this change, we provided an option for the user to convert the decimal number to BigDecimal of his own chosen scale (or precision) which should help handle numbers ending in 0 not to get converted into scientific notation. PR notes in the below link has the details about about how to use this and what kind of flexibility user has to tune his needs. Hence marking this ticket as fixed.

#4557

@github-project-automation github-project-automation bot moved this from Unplanned to Done in Data Prepper Tracking Board Jul 29, 2024
@dlvenable
Copy link
Member

The solution to provide a scale is useful, but ideally, the dynamodb source can automatically handle this situation so that customers do not have to add the manual conversions.

@dlvenable dlvenable reopened this Sep 6, 2024
@github-project-automation github-project-automation bot moved this from Done to In progress in Data Prepper Tracking Board Sep 6, 2024
@dlvenable dlvenable removed this from the v2.9 milestone Sep 6, 2024
@dblock dblock removed the untriaged label Sep 9, 2024
@dblock
Copy link
Member

dblock commented Sep 9, 2024

[Catch All Triage - 1, 2, 3, 4]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Priority-High
Projects
Development

No branches or pull requests

5 participants