Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DRAFT] CDC mirrors with SCHEMA MAPPING support #420

Closed
wants to merge 2 commits into from

Conversation

heavycrystal
Copy link
Contributor

support only for Postgres and Snowflake for now

for _, table := range populateTableMappingFromSchemasOutput.TableMapping[srcSchema].Tables {
flowConnectionConfigs.TableNameMapping[fmt.Sprintf("%s.%s", srcSchema, table)] =
fmt.Sprintf("%s.%s", dstSchema, table)

Copy link
Contributor

Choose a reason for hiding this comment

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

🚫 [golangci] reported by reviewdog 🐶
unnecessary trailing newline (whitespace)

Copy link
Contributor

@iskakaushik iskakaushik left a comment

Choose a reason for hiding this comment

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

Please let me know once these are fixed, I'll take another look.

@@ -127,6 +124,9 @@ message SetupReplicationInput {
bool do_initial_copy = 5;
string existing_publication_name = 6;
string existing_replication_slot_name = 7;

// if length > 0, ignore table name mapping and use schemas as basis of publication creation
Copy link
Contributor

Choose a reason for hiding this comment

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

instead of this, can we pass the mapping type here?

protos/flow.proto Outdated Show resolved Hide resolved
protos/flow.proto Outdated Show resolved Hide resolved
protos/flow.proto Outdated Show resolved Hide resolved
protos/flow.proto Outdated Show resolved Hide resolved
protos/flow.proto Show resolved Hide resolved
flow/connectors/core.go Outdated Show resolved Hide resolved
@@ -282,6 +284,8 @@ type SyncResponse struct {
TableSchemaDelta *protos.TableSchemaDelta
// to be stored in state for future PullFlows
RelationMessageMapping RelationMessageMapping
// to be used to create additional tables, for MappingType SCHEMA
AdditionalTableInfo *protos.AdditionalTableInfo
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we push this info to TableSchemaDelta?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

refactored into an interface of various deltas

flow/model/model.go Show resolved Hide resolved
Copy link
Contributor

@iskakaushik iskakaushik left a comment

Choose a reason for hiding this comment

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

Please let me know once these are fixed, I'll take another look.


// if the functions are being called outside the context of a Temporal workflow,
// activity.RecordHeartbeat panics, this is a bandaid for that.
func (c *PostgresConnector) recordHeartbeatWithRecover(details ...interface{}) {
Copy link
Contributor

Choose a reason for hiding this comment

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

🚫 [golangci] reported by reviewdog 🐶
func (*PostgresConnector).recordHeartbeatWithRecover is unused (unused)

@@ -478,7 +478,7 @@ func (c *SnowflakeConnector) SyncRecords(req *model.SyncRecordsRequest) (*model.
}

func (c *SnowflakeConnector) syncRecordsViaSQL(req *model.SyncRecordsRequest, rawTableIdentifier string,
syncBatchID int64, syncRecordsTx *sql.Tx) (*model.SyncResponse, error) {
syncBatchID int64, syncRecordsTx *sql.Tx) (*protos.SyncResponse, error) {
Copy link
Contributor

Choose a reason for hiding this comment

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

🚫 [golangci] reported by reviewdog 🐶
unnecessary leading newline (whitespace)

@saisrirampur
Copy link
Contributor

+1 this feature would have helped a customer we chatted with today.

@heavycrystal heavycrystal marked this pull request as draft February 6, 2024 15:27
@serprex serprex deleted the schema-mapping-support branch July 19, 2024 15:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants