Allow mapped integers to be mapped back to integral BigDecimals #3965
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.
Identify the Bug or Feature request
Fixes #3895
Description of the Change
The root of the problem is that when we send
execFunction
parameters to clients, each parameter is represented as aScriptTypeDto
which supports doubles strings and JSON values. Numbers (represented asBigDecimal
) are represented as doubles regardless of whether they are integral or not. When the client receives the parameters, the doubles are converted back toBigDecimal
, but integral values still keep their fractional part and thus the string representation can't be parsed as integers.This PR changes the client side conversion to remove zero fractional parts that might exist in the
BigDecimal
on the client side. This guarantees the string representation can be parsed by functions likeInteger.valueOf()
. Note that this change only applies to parameters ofexecFunction()
.I've also added logging for when the callee of
execFunction
fails, so that similar issues in the future can be more easily diagnosed.Possible Drawbacks
None
Documentation Notes
N/A
Release Notes
execFunction()
could not runplayStream()
on clients if two or more parameters were passed.This change is