-
Notifications
You must be signed in to change notification settings - Fork 97
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
CDC: Check for existing table in PG, SF, BQ #756
Conversation
@@ -738,20 +766,23 @@ func (c *SnowflakeConnector) SyncFlowCleanup(jobName string) error { | |||
return nil | |||
} | |||
|
|||
func (c *SnowflakeConnector) checkIfTableExists(schemaIdentifier string, tableIdentifier string) (bool, error) { | |||
rows, err := c.database.QueryContext(c.ctx, checkIfTableExistsSQL, schemaIdentifier, tableIdentifier) | |||
func (c *SnowflakeConnector) checkIfTableExists(schemaIdentifier string, tableIdentifier string) ([]protos.TableColumn, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [golangci] reported by reviewdog 🐶
line is 128 characters (lll)
flow/connectors/bigquery/bigquery.go
Outdated
return nil, fmt.Errorf("destination column %s not found in source: ", existingField.Name) | ||
} | ||
if existingField.Name != desiredField.Name || existingField.Type != desiredField.Type { | ||
return nil, fmt.Errorf("failed to setup normalized table due to incompatible columns: %s (destination) and %s (source)", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [golangci] reported by reviewdog 🐶
line is 140 characters (lll)
flow/connectors/bigquery/bigquery.go
Outdated
return nil, fmt.Errorf("destination column %s not found in source: ", existingField.Name) | ||
} | ||
if existingField.Name != desiredField.Name || existingField.Type != desiredField.Type { | ||
return nil, fmt.Errorf("failed to setup normalized table due to incompatible columns: %s (destination) and %s (source)", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [golangci] reported by reviewdog 🐶
line is 140 characters (lll)
e3f59f7
to
0f419c0
Compare
This feature is more complicated than originally pipelined due to newer features related to PeerDB columns, schema changes and so on. Closing with the aim of building this check on top of a newer PeerDB |
We now check if an existing destination table with the same name as the source table has the same schema as the source (ignoring _PEERDB columns we create for snowflake mirrors)
Fixes #256