schemastore: fix create table like with unqualified source table#5023
schemastore: fix create table like with unqualified source table#5023lidezhu wants to merge 9 commits into
Conversation
|
Skipping CI for Draft Pull Request. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughRefactors persisted DDL handling for CREATE TABLE ... LIKE: add a resolver that selects the referenced schema from the explicit LIKE clause, InvolvingSchemaInfo, or the event schema; optionally rewrite the parsed query when inferring schema. Includes unit tests, integration scenarios, and CI test-group updates. ChangesCREATE TABLE LIKE Schema Resolution
Sequence Diagram(s)(omitted — change is focused on resolver and local handler call flow already summarized above) Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 golangci-lint (2.12.2)Command failed Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Code Review
This pull request enhances the integration tests for consistent DDL replication by introducing a cross-database CREATE TABLE ... LIKE test case. The reviewer suggested improving the robustness of the test by specifying explicit character sets and collations for the new database, using fully qualified table names in DDL statements to prevent context-related failures in replication, and adding verification steps for the source table in the downstream environment.
|
/gemini summary |
|
@coderabbitai review |
Summary of ChangesThis pull request addresses issues with 'CREATE TABLE ... LIKE' DDL replication, particularly when the source database is not explicitly specified. By improving the schema resolution logic within the persisted storage handler, the system can now correctly identify and replicate tables across different schemas and databases, including support for partitioned tables. These changes ensure more reliable DDL replication in complex environments. Highlights
New Features🧠 You can now enable Memory (public preview) to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Activity
|
|
/gemini review |
✅ Actions performedReview triggered.
|
There was a problem hiding this comment.
Code Review
This pull request enhances the resolution of the source table's schema for CREATE TABLE ... LIKE statements, particularly for cross-database operations. It introduces logic to infer the source schema from InvolvingSchemaInfo and ensures the resulting DDL query is fully qualified when necessary. The changes include new unit and integration tests to verify these scenarios. Review feedback suggests optimizing the fallback logic in resolveCreateTableLikeReferSchema by using the job's SchemaID directly instead of performing a redundant name-based lookup.
|
/test all |
|
/retest |
|
/test all |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: wk989898 The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
[LGTM Timeline notifier]Timeline:
|
|
/retest |
|
/test all |
|
/retest |
What problem does this PR solve?
Issue Number: close #5025
What is changed and how it works?
This pull request addresses issues with 'CREATE TABLE ... LIKE' DDL replication, particularly when the source database is not explicitly specified. By improving the schema resolution logic within the persisted storage handler, the system can now correctly identify and replicate tables across different schemas and databases, including support for partitioned tables. These changes ensure more reliable DDL replication in complex environments.
Highlights
Check List
Tests
Questions
Will it cause performance regression or break compatibility?
Do you need to update user documentation, design documentation or monitoring documentation?
Release note
Summary by CodeRabbit
Bug Fixes
Tests
Chores