Skip to content

update to filter on tableNames#4008

Open
derrickaw wants to merge 7 commits into
GoogleCloudPlatform:mainfrom
derrickaw:20260709_cloudSpannerGCSAvroIssue
Open

update to filter on tableNames#4008
derrickaw wants to merge 7 commits into
GoogleCloudPlatform:mainfrom
derrickaw:20260709_cloudSpannerGCSAvroIssue

Conversation

@derrickaw

@derrickaw derrickaw commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

tries to fix ##3917

@codecov

codecov Bot commented Jul 9, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 80 lines in your changes missing coverage. Please review.
✅ Project coverage is 55.70%. Comparing base (2d76a99) to head (c6b3e31).
⚠️ Report is 15 commits behind head on main.

Files with missing lines Patch % Lines
...google/cloud/teleport/spanner/ExportTransform.java 0.00% 77 Missing ⚠️
...teleport/spanner/BuildReadFromTableOperations.java 0.00% 1 Missing and 2 partials ⚠️

❌ Your patch check has failed because the patch coverage (0.00%) is below the target coverage (80.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #4008      +/-   ##
============================================
- Coverage     55.70%   55.70%   -0.01%     
- Complexity     6774     6783       +9     
============================================
  Files          1125     1124       -1     
  Lines         68437    68490      +53     
  Branches       7719     7737      +18     
============================================
+ Hits          38121    38150      +29     
- Misses        27844    27861      +17     
- Partials       2472     2479       +7     
Components Coverage Δ
spanner-templates 87.66% <ø> (-0.02%) ⬇️
spanner-import-export 68.59% <0.00%> (-0.13%) ⬇️
spanner-live-forward-migration 89.29% <ø> (ø)
spanner-live-reverse-replication 83.46% <ø> (ø)
spanner-bulk-migration 92.48% <ø> (-0.03%) ⬇️
gcs-spanner-dv 88.55% <ø> (ø)
Files with missing lines Coverage Δ
...teleport/spanner/BuildReadFromTableOperations.java 75.71% <0.00%> (+30.78%) ⬆️
...google/cloud/teleport/spanner/ExportTransform.java 15.22% <0.00%> (-1.23%) ⬇️

... and 24 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.

@derrickaw

Copy link
Copy Markdown
Contributor Author

/gemini review

@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 updates the Spanner export process in ExportTransform.java to support exporting a filtered subset of tables specified by the tableNames parameter, rather than exporting all database entities by default. It also updates the associated tests in ExportRelatedTablesCheckTest.java to verify this behavior. The review feedback highlights several critical issues: multiple potential NullPointerException occurrences when calling .trim() on a null tableNames.get() value, and a performance inefficiency in the sequence filtering logic where t.prettyPrint() is repeatedly called inside a stream. Code suggestions are provided to safely handle null values and cache the pretty-printed table strings.

Comment thread v1/src/main/java/com/google/cloud/teleport/spanner/ExportTransform.java Outdated
Comment thread v1/src/main/java/com/google/cloud/teleport/spanner/ExportTransform.java Outdated
Comment thread v1/src/main/java/com/google/cloud/teleport/spanner/ExportTransform.java Outdated
Comment thread v1/src/main/java/com/google/cloud/teleport/spanner/ExportTransform.java Outdated
Comment thread v1/src/main/java/com/google/cloud/teleport/spanner/ExportTransform.java Outdated
Comment thread v1/src/main/java/com/google/cloud/teleport/spanner/ExportTransform.java Outdated
Comment thread v1/src/main/java/com/google/cloud/teleport/spanner/ExportTransform.java Outdated
Comment thread v1/src/main/java/com/google/cloud/teleport/spanner/ExportTransform.java Outdated
@derrickaw

Copy link
Copy Markdown
Contributor Author

/gemini review

@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 updates the Spanner export pipeline to selectively export only the specified tables and their associated schema entities, such as sequences and schemas, instead of exporting all entities. It also introduces null checks to prevent potential NullPointerExceptions when parsing table names and updates the test suite to reflect these changes. The reviewer identified an issue in ExportTransform.java where checking if a sequence name is a substring of a table's definition could lead to false positives, and suggested using a regex pattern with word boundaries to ensure exact matching.

@derrickaw
derrickaw marked this pull request as ready for review July 13, 2026 21:20
@derrickaw
derrickaw requested a review from a team as a code owner July 13, 2026 21:20
@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 improves the table filtering functionality in the Spanner export pipeline. By ensuring that table name inputs are properly validated and handled, the changes prevent the export of extraneous tables and metadata when a specific subset of tables is requested. This results in a more precise and efficient export process.

Highlights

  • Table Filtering Logic: Updated the table filtering mechanism to correctly handle null or empty table name inputs, ensuring that only specified tables are processed when provided.
  • Schema and Metadata Filtering: Refined the export logic to conditionally filter sequences, schemas, and other metadata based on the provided table list, preventing the export of unnecessary entities.
  • Test Suite Updates: Updated existing tests to reflect the new filtering behavior and added a new test case to verify the handling of null table inputs.
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 updates the Spanner export and import pipelines to ensure that only the selected tables and their associated schemas and sequences are exported and re-created, rather than all database entities. It also introduces null and empty checks for table name parameters to prevent potential NullPointerExceptions. The review feedback suggests validating mandatory parameters like tables for nullability at the entry point or in upstream components to avoid redundant null checks in downstream transforms.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant