update to filter on tableNames#4008
Conversation
Codecov Report❌ Patch coverage is ❌ 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
🚀 New features to boost your workflow:
|
|
/gemini review |
There was a problem hiding this comment.
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.
|
/gemini review |
There was a problem hiding this comment.
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.
Summary of ChangesHello, 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
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 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 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
|
There was a problem hiding this comment.
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.
tries to fix ##3917