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

Add support for BigDecimal in ConvertType processor #4316

Closed
engechas opened this issue Mar 21, 2024 · 4 comments · Fixed by #4395
Closed

Add support for BigDecimal in ConvertType processor #4316

engechas opened this issue Mar 21, 2024 · 4 comments · Fixed by #4395
Labels
enhancement New feature or request
Milestone

Comments

@engechas
Copy link
Collaborator

Is your feature request related to a problem? Please describe.
When using DDB source, some of the incoming data gets typed as BigDecimal. This type is not supported by the ConvertEntries processor which results in the below exception

Unable to convert key: ****** with value: ****** to ******
java.lang.IllegalArgumentException: Unsupported type conversion. Source class: class java.math.BigDecimal
	at org.opensearch.dataprepper.typeconverter.IntegerConverter.convert(IntegerConverter.java:22) ~[data-prepper-api-2.6.1.jar:?]
	at org.opensearch.dataprepper.typeconverter.IntegerConverter.convert(IntegerConverter.java:8) ~[data-prepper-api-2.6.1.jar:?]
 at org.opensearch.dataprepper.plugins.processor.mutateevent.ConvertEntryTypeProcessor.doExecute(ConvertEntryTypeProcessor.java:68) ~[mutate-event-processors-2.6.1.jar:?]

Describe the solution you'd like
BigDecimal should be added to the supported conversion types

Describe alternatives you've considered (Optional)
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.

@kkondaka
Copy link
Collaborator

For now, if the values are small enough to fit in long/int, conversion to String should work (and if needed, convert it back to integer or long) as a work-around

@Utkarsh-Aga
Copy link
Contributor

Hello @engechas @kkondaka ,
Can I work on raising the PR for this ?

@dlvenable
Copy link
Member

@Utkarsh-Aga , That would be great. It would be quite similar to the work you did in #4359.

@Utkarsh-Aga
Copy link
Contributor

Sure, Thanks.
I would work on raising the PR for this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Development

Successfully merging a pull request may close this issue.

4 participants