Skip to content

added oracle support to data validation - #4173

Open
bharadwaj-aditya wants to merge 1 commit into
GoogleCloudPlatform:mainfrom
bharadwaj-aditya:dv_add_oracle_support
Open

added oracle support to data validation#4173
bharadwaj-aditya wants to merge 1 commit into
GoogleCloudPlatform:mainfrom
bharadwaj-aditya:dv_add_oracle_support

Conversation

@bharadwaj-aditya

Copy link
Copy Markdown
Contributor

Added support for oracle validations in the data validation template.

@bharadwaj-aditya bharadwaj-aditya added the addition New feature or request label Aug 24, 2026
@bharadwaj-aditya
bharadwaj-aditya marked this pull request as ready for review August 24, 2026 16:05
@bharadwaj-aditya
bharadwaj-aditya requested a review from a team as a code owner August 24, 2026 16:05
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, 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 introduces support for Oracle data types within the data validation template. By extending the visitor pattern to handle Float32 values and implementing robust unit and integration tests, the changes ensure that data validation remains accurate and consistent across different data types during migration processes.

Highlights

  • Float32 Support: Added support for the Float32 data type across the visitor interface and its implementations, including the hasher and string visitors.
  • Comprehensive Testing: Introduced a new unit test suite to validate hash parity for all Oracle data types and added an integration smoke test to verify end-to-end validation.
  • Helper Utilities: Enhanced the Avro setup helper with new methods for schema parsing and improved conversion logic for BigDecimal and byte arrays.
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 the 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 counterproductive. 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.

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.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

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 introduces support for the FLOAT32 data type in the unified visitor and hasher classes, and adds comprehensive integration and unit tests validating Oracle data type mappings, including a new smoke test (GCSSpannerDVOracleSmokeIT). Feedback on the changes suggests removing an unnecessary Thread.sleep delay in the integration test since Dataflow provisioning time is sufficient to satisfy the staleness window, and updating the dispatch logic in IUnifiedVisitor to handle PG_UUID using value.getUuid() instead of value.getString().

Comment on lines +185 to +186
// Wait for Spanner's 20-second exact staleness read bound in SpannerReaderTransform
Thread.sleep(20000);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

In template integration tests that perform stale reads (such as Spanner's exact staleness read bound), there is no need to add a delay (like Thread.sleep) before executing the pipeline when running on Dataflow. The setup and provisioning time of the Dataflow runner is more than sufficient to satisfy the staleness window. Removing this sleep will speed up the integration test execution.

References
  1. When writing integration tests that perform stale reads (such as Spanner's exact staleness read bound), do not add a delay (e.g., Thread.sleep) before executing the pipeline if the test runs using DataflowRunner, as the runner's setup time is long enough to satisfy the staleness window.

case UUID -> visitor.visitUuid(value.getUuid());
case INT64 -> visitor.visitInt64(value.getInt64());
case FLOAT64 -> visitor.visitFloat64(value.getFloat64());
case FLOAT32 -> visitor.visitFloat32(value.getFloat32());

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

When retrieving UUID or PG_UUID values from Cloud Spanner Value objects, we should use value.getUuid() instead of value.getString() as UUID values are received as UUID objects. Please update the UUID case in the dispatch switch to also handle PG_UUID:

      case UUID, PG_UUID -> visitor.visitUuid(value.getUuid());
References
  1. When retrieving UUID or PG_UUID values from Cloud Spanner Value objects, use value.getUuid() instead of value.getString() as UUID values are received as UUID objects.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

addition New feature or request size/XXL

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants