Skip to content

Add Oracle Live datatype ITs - #4492

Open
dhwanilpatel wants to merge 3 commits into
GoogleCloudPlatform:mainfrom
dhwanilpatel:oracle_live_datatype_it
Open

dhwanilpatel wants to merge 3 commits into
GoogleCloudPlatform:mainfrom
dhwanilpatel:oracle_live_datatype_it

Conversation

@dhwanilpatel

Copy link
Copy Markdown
Contributor

Add Oracle Live datatype IT

@codecov

codecov Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 62.48%. Comparing base (306f713) to head (8fdab99).
⚠️ Report is 7 commits behind head on main.

Additional details and impacted files
@@              Coverage Diff              @@
##               main    #4492       +/-   ##
=============================================
+ Coverage     40.97%   62.48%   +21.51%     
- Complexity      741     3776     +3035     
=============================================
  Files           210      600      +390     
  Lines         15359    36598    +21239     
  Branches       1628     4146     +2518     
=============================================
+ Hits           6294    22870    +16576     
- Misses         8545    12567     +4022     
- Partials        520     1161      +641     
Components Coverage Δ
spanner-templates 83.68% <ø> (∅)
spanner-import-export ∅ <ø> (∅)
spanner-live-forward-migration 86.88% <ø> (∅)
spanner-live-reverse-replication 79.18% <ø> (∅)
spanner-bulk-migration 87.85% <ø> (∅)
gcs-spanner-dv 85.66% <ø> (∅)
see 402 files with indirect coverage changes
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@dhwanilpatel
dhwanilpatel force-pushed the oracle_live_datatype_it branch from 28893cb to 00814d3 Compare October 27, 2026 15:31
@dhwanilpatel
dhwanilpatel marked this pull request as ready for review October 28, 2026 05:01
@dhwanilpatel
dhwanilpatel requested a review from a team as a code owner October 28, 2026 05:01
@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 a robust integration testing framework for verifying Oracle data type replication to Spanner. It covers a wide range of data types and mapping scenarios, ensuring data integrity across both backfill and CDC replication paths for both GoogleSQL and PostgreSQL-dialect Spanner databases.

Highlights

  • Integration Test Suite: Added a comprehensive integration test suite for Oracle data type replication to Spanner, covering various scenarios including default mappings, alternative mappings, primary keys, and unsupported types.
  • Schema Definitions: Included SQL schema definitions for both GoogleSQL and PostgreSQL-dialect Spanner databases to support the new integration tests.
  • CDC Support: Implemented CDC testing logic using an oracle-cdc.sql script to verify data replication from redo logs.
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 comprehensive integration tests for replicating Oracle data types to both GoogleSQL and PostgreSQL-dialect Spanner databases using the Datastream-to-Spanner template. It includes test data, test cases, and DDL schemas for both dialects. The review feedback highlights a critical syntax error in the GoogleSQL Spanner schema file, where trailing commas in the table definitions will cause DDL execution to fail.

* <p><b>LOB validation is disabled (6 tables, {@link #LOB_TABLES_NOT_VALIDATED}: {@code
* blob_table}, {@code blob_to_str_table}, {@code clob_table}, {@code clob_to_bytes_table}, {@code
* nclob_table}, {@code nclob_to_bytes_table})</b>: the test does not enable Datastream
* large-object streaming ({@code OracleSourceConfig.stream_large_objects}), and without it

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.

why is this not enabled on datastream ? If we support it we should test it

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This will need change in common folder in it/google-cloud-platform package for enabling streaming for datastream. I will make that change as a followup after this PR and enable this validations.


@AfterClass
public static void cleanUp() {
cleanUpSharedResources(testInstances);

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.

please check if the jobs are killed after the test completes or after all the tests are successful. It is preferable to cleanup resources after the test rather than waiting for all the tests - where possible.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

There are some shared resources and some test specific resource. I will divide those and clean test specific resources [dataflow/datastream] after test and clean shared resource [pubsub/gcs] in afterClass.

@@ -0,0 +1,1086 @@
CREATE TABLE "varchar2_table" ("id" NUMBER(10) NOT NULL, "varchar2_col" VARCHAR2(4000), PRIMARY KEY ("id"));

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.

nit: This dataset - and the others can be used across live and bulk. Can you evaluate if that is possible - to avoid duplication and ensure coverage ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

We can explore that, but a couple of things to highlight:

  1. Expected values differ between bulk and live even for the same data (JDBC vs Datastream output), so each IT would still keep its own expectations. We'd mostly save one DDL file.
  2. Live has some Datastream and template limitations (e.g. unsupported types, and TIMESTAMP WITH TIME ZONE restricted to UTC values), so sharing the dataset could reduce bulk's coverage too.

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.

2 participants