-
Notifications
You must be signed in to change notification settings - Fork 22
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
[NR-302034] fix: handle DECIMAL values in custom queries #173
Merged
sigilioso
merged 7 commits into
master
from
NR-302034-fix-decimal-values-custom-queries
Sep 16, 2024
Merged
[NR-302034] fix: handle DECIMAL values in custom queries #173
sigilioso
merged 7 commits into
master
from
NR-302034-fix-decimal-values-custom-queries
Sep 16, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sigilioso
commented
Sep 12, 2024
sigilioso
force-pushed
the
NR-302034-fix-decimal-values-custom-queries
branch
2 times, most recently
from
September 12, 2024 14:57
4e86eab
to
150264f
Compare
sigilioso
force-pushed
the
NR-302034-fix-decimal-values-custom-queries
branch
from
September 12, 2024 15:02
150264f
to
64016f4
Compare
paologallinaharbur
approved these changes
Sep 16, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Way easier to follow now!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This PR updates the function handling custom queries in order that it can parse DECIMAL values.
The previous implementation was scanning all the values into
interface{}
values, which means that the driver performs no conversion, and later it was converting all the values to string, to finally try to convert toFloat64
for the corresponding types. This wasn't working well because the driver represents DECIMAL values asuint8[]
and the corresponding conversion to string was an array of bytes. We have updated it to directly scan the values into thestring
type (which tells the driver to perform the corresponding conversion) and later, we keep converting the strings to numbers only when needed.The PR also includes a small refactor of the function handling custom queries and some unit-test to try to assure its behavior doesn't change.