Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
Amogh-Bharadwaj committed Oct 16, 2023
1 parent 492422d commit 9ff5dec
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
5 changes: 3 additions & 2 deletions flow/connectors/postgres/qrep_query_executor.go
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,8 @@ func (qe *QRepQueryExecutor) ExecuteAndProcessQueryStream(
return totalRecordsFetched, nil
}

func mapRowToQRecord(row pgx.Rows, fds []pgconn.FieldDescription, customTypeMap map[uint32]string) (*model.QRecord, error) {
func mapRowToQRecord(row pgx.Rows, fds []pgconn.FieldDescription,
customTypeMap map[uint32]string) (*model.QRecord, error) {
// make vals an empty array of QValue of size len(fds)
record := model.NewQRecord(len(fds))

Expand All @@ -436,7 +437,7 @@ func mapRowToQRecord(row pgx.Rows, fds []pgconn.FieldDescription, customTypeMap
Kind: customTypeToQKind(typeName),
Value: values[i],
}
record.Set(i, *&customTypeVal)
record.Set(i, customTypeVal)
}
}

Expand Down
3 changes: 1 addition & 2 deletions flow/connectors/postgres/qvalue_convert.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,11 @@ func postgresOIDToQValueKind(recvOID uint32) qvalue.QValueKind {
return qvalue.QValueKindString
} else if recvOID == uint32(oid.T_tsquery) { // TSQUERY
return qvalue.QValueKindString
} else if recvOID == uint32(oid.T_point) {
} else if recvOID == uint32(oid.T_point) { // POINT
return qvalue.QValueKindPoint
}

return qvalue.QValueKindInvalid

} else {
log.Warnf("unsupported field type: %v - type name - %s; returning as string", recvOID, typeName.Name)
return qvalue.QValueKindString
Expand Down
6 changes: 4 additions & 2 deletions flow/connectors/snowflake/qrep_avro_sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -285,9 +285,11 @@ func (sc *SnowflakeConnector) GetCopyTransformation(dstTableName string) (*CopyI
transformations = append(transformations,
fmt.Sprintf("TO_GEOMETRY($1:\"%s\"::string) AS \"%s\"", colName, colName))
case "NUMBER":
transformations = append(transformations, fmt.Sprintf("$1:\"%s\" AS \"%s\"", colName, colName))
transformations = append(transformations,
fmt.Sprintf("$1:\"%s\" AS \"%s\"", colName, colName))
default:
transformations = append(transformations, fmt.Sprintf("($1:\"%s\")::%s AS \"%s\"", colName, colType, colName))
transformations = append(transformations,
fmt.Sprintf("($1:\"%s\")::%s AS \"%s\"", colName, colType, colName))
}
}
transformationSQL := strings.Join(transformations, ",")
Expand Down

0 comments on commit 9ff5dec

Please sign in to comment.