Skip to content

Commit

Permalink
Remove TODOs since those edgecases are explicitly disallowed now
Browse files Browse the repository at this point in the history
  • Loading branch information
serprex committed Nov 10, 2023
1 parent 9eb2d17 commit 834ea32
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
21 changes: 11 additions & 10 deletions flow/workflows/setup_flow.go
Original file line number Diff line number Diff line change
Expand Up @@ -197,17 +197,18 @@ func (s *SetupFlowExecution) fetchTableSchemaAndSetupNormalizedTables(
for _, srcTableName := range sortedSourceTables {
tableSchema := tableNameSchemaMapping[srcTableName]
normalizedTableName := s.tableNameMapping[srcTableName]
// TODO source can be used for multiple targets, need to adjust based on destination
for _, mapping := range flowConnectionConfigs.TableMappings {
if mapping.SourceTableIdentifier == srcTableName && len(mapping.Exclude) != 0 {
tableSchema = &protos.TableSchema{
TableIdentifier: tableSchema.TableIdentifier,
Columns: maps.Clone(tableSchema.Columns),
PrimaryKeyColumns: tableSchema.PrimaryKeyColumns,
IsReplicaIdentityFull: tableSchema.IsReplicaIdentityFull,
}
for _, exclude := range mapping.Exclude {
delete(tableSchema.Columns, exclude)
if mapping.SourceTableIdentifier == srcTableName {
if len(mapping.Exclude) != 0 {
tableSchema = &protos.TableSchema{
TableIdentifier: tableSchema.TableIdentifier,
Columns: maps.Clone(tableSchema.Columns),
PrimaryKeyColumns: tableSchema.PrimaryKeyColumns,
IsReplicaIdentityFull: tableSchema.IsReplicaIdentityFull,
}
for _, exclude := range mapping.Exclude {
delete(tableSchema.Columns, exclude)
}
}
break
}
Expand Down
1 change: 0 additions & 1 deletion flow/workflows/snapshot_flow.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,6 @@ func (s *SnapshotFlowExecution) cloneTable(
}
from := "*"
if len(mapping.Exclude) != 0 {
// TODO need to verify destination is right
for _, v := range s.config.TableNameSchemaMapping {
if v.TableIdentifier == srcName {
from = strings.Join(maps.Keys(v.Columns), ",")
Expand Down

0 comments on commit 834ea32

Please sign in to comment.