Adding schema loader transform to cdc data generator#3483
Adding schema loader transform to cdc data generator#3483shreyakhajanchi wants to merge 5 commits intoGoogleCloudPlatform:mainfrom
Conversation
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 significantly enhances the CDC data generator by introducing a flexible and robust mechanism for loading database schemas directly from target sinks. This new framework, which currently supports Spanner and MySQL, allows the data generator to dynamically adapt to the schema of the destination database, ensuring more accurate and relevant synthetic data generation. The changes involve defining generic interfaces for schema fetching and type mapping, providing concrete implementations for supported databases, and integrating this functionality as a Beam transform for pipeline execution. Highlights
Changelog
Activity
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 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 counter productive. 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. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
Add Schema Fetching Abstraction for CDC Data Generator
This PR introduces a flexible mechanism for fetching schemas from various sinks (Spanner, MySQL) to be used with the CDC Data Generator.
Key Features & Components:
SinkSchemaFetcherInterface: A common interface (com.google.cloud.teleport.v2.templates.sink.SinkSchemaFetcher) for abstracting the schema retrieval process from different database sinks.SpannerSchemaFetcher: Fetches schema information from Cloud Spanner using the Spanner API and DDL information.MySqlSchemaFetcher: Fetches schema information from MySQL using JDBC andMySqlInformationSchemaScanner.TypeMapperInterface: An interface (com.google.cloud.teleport.v2.templates.sink.TypeMapper) to convert sink-specific data types into a commonLogicalTypeused by the data generator.SpannerTypeMapper) and MySQL (MySqlTypeMapper).FetchSchemaFn: A BeamDoFn(com.google.cloud.teleport.v2.templates.dofn.FetchSchemaFn) responsible for orchestrating the schema fetching process using the appropriateSinkSchemaFetcherbased on the configuredSinkType.SchemaLoaderTransform: TheSchemaLoaderutilizesFetchSchemaFnto load the sink schema as a side input for the pipeline. It's designed to be extensible for other sink types.Notes:
MySqlTypeMapperandSpannerTypeMapperprovide foundational coverage and will be expanded in future PRs to handle more types.