Skip to content

Commit 0e5edf9

Browse files
committed
Fix Snowflake resync failure due to case mismatch in _resync table suffix (#4184)
The resync suffix was appended in lowercase ("_resync"), producing mixed-case identifiers like "ACCOUNTS_resync". However, getColsFromTable() in qrep.go unconditionally applies strings.ToUpper(), converting it to "ACCOUNTS_RESYNC". Since Snowflake treats quoted identifiers as case-sensitive, the table lookup fails with "does not exist". Uppercase the suffix to "_RESYNC" so both creation and query paths produce consistent identifiers.
1 parent af8af34 commit 0e5edf9

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

flow/workflows/cdc_flow.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -594,7 +594,7 @@ func CDCFlowWorkflow(
594594
if cfg.Resync {
595595
for _, mapping := range state.SyncFlowOptions.TableMappings {
596596
if mapping.Engine != protos.TableEngine_CH_ENGINE_NULL {
597-
mapping.DestinationTableIdentifier += "_resync"
597+
mapping.DestinationTableIdentifier += "_RESYNC"
598598
}
599599
}
600600
// because we have renamed the tables.
@@ -727,7 +727,7 @@ func CDCFlowWorkflow(
727727
for _, mapping := range state.SyncFlowOptions.TableMappings {
728728
if mapping.Engine != protos.TableEngine_CH_ENGINE_NULL {
729729
oldName := mapping.DestinationTableIdentifier
730-
newName := strings.TrimSuffix(oldName, "_resync")
730+
newName := strings.TrimSuffix(oldName, "_RESYNC")
731731
renameOpts.RenameTableOptions = append(renameOpts.RenameTableOptions, &protos.RenameTableOption{
732732
CurrentName: oldName,
733733
NewName: newName,

0 commit comments

Comments
 (0)