Skip to content

Commit

Permalink
convert to switch case
Browse files Browse the repository at this point in the history
  • Loading branch information
Amogh-Bharadwaj committed Jan 2, 2024
1 parent 899348f commit d96edc9
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions flow/connectors/bigquery/qrep_avro_sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,12 +116,14 @@ func getTransformedColumns(dstTableMetadata *bigquery.TableMetadata, syncedAtCol
if col.Name == syncedAtCol || col.Name == softDeleteCol {
continue
}
if col.Type == bigquery.GeographyFieldType {
switch col.Type {
case bigquery.GeographyFieldType:
transformedColumns = append(transformedColumns,
fmt.Sprintf("ST_GEOGFROMTEXT(`%s`) AS `%s`", col.Name, col.Name))
} else if col.Type == bigquery.JSONFieldType {
transformedColumns = append(transformedColumns, fmt.Sprintf("PARSE_JSON(`%s`) AS `%s`", col.Name, col.Name))
} else {
case bigquery.JSONFieldType:
transformedColumns = append(transformedColumns,
fmt.Sprintf("PARSE_JSON(`%s`) AS `%s`", col.Name, col.Name))
default:
transformedColumns = append(transformedColumns, fmt.Sprintf("`%s`", col.Name))
}
}
Expand Down

0 comments on commit d96edc9

Please sign in to comment.