Skip to content

Conversation

jnmt
Copy link
Collaborator

@jnmt jnmt commented Oct 9, 2025

Description

This PR fixes bugs that prevent the use of FLOAT and BLOB 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

  • Change the expected data types of function arguments
  • Add comprehensive tests

Checklist

The following is a best-effort checklist. If any items in this checklist are not applicable to this PR or are dependent on other, unmerged PRs, please still mark the checkboxes after you have read and understood each item.

  • I have commented my code, particularly in hard-to-understand areas.
  • I have updated the documentation to reflect the changes.
  • I have considered whether similar issues could occur in other products, components, or modules if this PR is for bug fixes.
  • Any remaining open issues linked to this PR are documented and up-to-date (Jira, GitHub, etc.).
  • Tests (unit, integration, etc.) have been added for the changes.
  • My changes generate no new warnings.
  • Any dependent changes in other PRs have been merged and published.

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.

@Copilot Copilot AI review requested due to automatic review settings October 9, 2025 07:06
@jnmt jnmt self-assigned this Oct 9, 2025
@jnmt jnmt added the bugfix label Oct 9, 2025
Copy link

Summary of Changes

Hello @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 PutToMutable function that previously prevented the proper handling and storage of FLOAT and BLOB data types. The changes ensure that the function correctly interprets and processes these data types as they are deserialized from JSON, specifically by adjusting validation logic for floats (treated as doubles by Jackson) and blobs (expected as Base64-encoded strings). The update includes robust testing to confirm the fixes and expanded support for various data types.

Highlights

  • FLOAT Data Type Handling: The validation for FLOAT data types in the PutToMutable function has been updated to check for isDouble() instead of isFloat(), aligning with how Jackson deserializes float values as doubles.
  • BLOB Data Type Handling: The BLOB data type handling has been fixed to correctly process Base64-encoded strings, as JSON represents binary data in this format. The validation now checks for isTextual() and decodes the Base64 string.
  • Expanded Test Coverage: Comprehensive integration tests have been added and updated to cover various data types, including BOOLEAN, BIGINT, FLOAT, DOUBLE, BLOB, DATE, TIME, and TIMESTAMPTZ, as well as scenarios with null column values.
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@Copilot Copilot AI left a 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.

Copy link

@gemini-code-assist gemini-code-assist bot left a 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.

@jnmt jnmt requested review from choplin and feeblefakie October 9, 2025 07:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant