From 4ff4d1e1d20b4c06f7674e0b7a6297f0bd9ee02e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philip=20Dub=C3=A9?= Date: Fri, 29 Dec 2023 22:34:14 +0000 Subject: [PATCH] snapshot_flow: use table schema utils --- flow/workflows/snapshot_flow.go | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/flow/workflows/snapshot_flow.go b/flow/workflows/snapshot_flow.go index f965caf341..22085fef84 100644 --- a/flow/workflows/snapshot_flow.go +++ b/flow/workflows/snapshot_flow.go @@ -16,7 +16,6 @@ import ( "go.temporal.io/sdk/log" "go.temporal.io/sdk/temporal" "go.temporal.io/sdk/workflow" - "golang.org/x/exp/maps" ) type SnapshotFlowExecution struct { @@ -141,17 +140,12 @@ func (s *SnapshotFlowExecution) cloneTable( if len(mapping.Exclude) != 0 { for _, v := range s.config.TableNameSchemaMapping { if v.TableIdentifier == srcName { - if v.Columns != nil { - cols := maps.Keys(v.Columns) - for i, col := range cols { - cols[i] = fmt.Sprintf(`"%s"`, col) - } - from = strings.Join(cols, ",") - break - } else { - from = strings.Join(v.ColumnNames, ",") - break + colNames := utils.TableSchemaColumnNames(v) + for i, colName := range colNames { + colNames[i] = fmt.Sprintf(`"%s"`, colName) } + from = strings.Join(colNames, ",") + break } } }