-
Notifications
You must be signed in to change notification settings - Fork 3
Fix to handle FLOAT and BLOB data types in PutToMutable function #297
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
base: master
Are you sure you want to change the base?
Conversation
Summary of ChangesHello @jnmt, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request resolves critical bugs within the Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
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.
Pull Request Overview
This PR fixes bugs in the PutToMutable function for handling FLOAT and BLOB data types in HashStore by addressing JSON serialization limitations.
- Fixed FLOAT data type validation to check for double values instead of float values due to Jackson's handling
- Updated BLOB data type validation to accept Base64-encoded strings instead of binary data
- Added comprehensive tests for all data types including null column handling
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
File | Description |
---|---|
PutToMutableDatabase.java | Fixed type validation for FLOAT (check double) and BLOB (check textual) data types |
PutToMutableDatabaseTest.java | Updated test data and validation cases to match the fixed behavior |
GenericContractObjectAndCollectionEndToEndTest.java | Added comprehensive end-to-end tests for all data types including null handling |
objects-table-schema.json | Extended schema to include all data type columns for testing |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
...ntracts/src/main/java/com/scalar/dl/genericcontracts/object/v1_0_0/PutToMutableDatabase.java
Show resolved
Hide resolved
...ntracts/src/main/java/com/scalar/dl/genericcontracts/object/v1_0_0/PutToMutableDatabase.java
Show resolved
Hide resolved
...test/java/com/scalar/dl/genericcontracts/GenericContractObjectAndCollectionEndToEndTest.java
Show resolved
Hide resolved
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.
Code Review
This pull request addresses bugs in the PutToMutable
function related to handling FLOAT
and BLOB
data types. The changes correctly align with Jackson's deserialization behavior by expecting FLOAT
values as doubles and BLOB
values as Base64-encoded strings. The test suite has been significantly expanded to cover a wider range of data types, including various time-related types and null values, which greatly improves confidence in the function's correctness. My review includes a couple of suggestions to further improve the test code's robustness and enhance error handling.
Description
This PR fixes bugs that prevent the use of
FLOAT
andBLOB
data types when putting mutable records in HashStore.The Jackson deserializer always handles (strings of) float and double values as double values since it cannot decide which ones by itself. So, we needed to check whether it's double or not instead of checking as float values. Also, JSON does not support blob data, and Jackson serializer represents it as a Base64-encoded string. So, we needed to follow it.
Thank you for reporting it, @yu2scalar.
Related issues and/or PRs
Changes made
Checklist
Additional notes (optional)
ScalarDL 3.12.x users can register the fixed Function by running the bootstrap command. ScalarDL 3.11.x and 3.10.x users manually register the fixed Function.
Release notes
Fixed bugs to handle FLOAT and BLOB data types in the PutToMutable function.