diff --git a/flow/connectors/clickhouse/normalize.go b/flow/connectors/clickhouse/normalize.go index dec9c396d..51bbf7c1e 100644 --- a/flow/connectors/clickhouse/normalize.go +++ b/flow/connectors/clickhouse/normalize.go @@ -82,7 +82,6 @@ func getColName(overrides map[string]string, name string) string { } func getClickhouseTypeForNumericColumn(ctx context.Context, column *protos.FieldDescription, env map[string]string) (string, error) { - rawPrecision, _ := datatypes.ParseNumericTypmod(column.TypeModifier) if column.TypeModifier == -1 { numericAsStringEnabled, err := peerdbenv.PeerDBEnableClickHouseNumericAsString(ctx, env) if err != nil { @@ -91,12 +90,11 @@ func getClickhouseTypeForNumericColumn(ctx context.Context, column *protos.Field if numericAsStringEnabled { return "String", nil } - precision, scale := datatypes.GetNumericTypeForWarehouse(column.TypeModifier, datatypes.ClickHouseNumericCompatibility{}) - return fmt.Sprintf("Decimal(%d, %d)", precision, scale), nil - } - - if rawPrecision > datatypes.PeerDBClickHouseMaxPrecision { - return "String", nil + } else { + rawPrecision, _ := datatypes.ParseNumericTypmod(column.TypeModifier) + if rawPrecision > datatypes.PeerDBClickHouseMaxPrecision { + return "String", nil + } } precision, scale := datatypes.GetNumericTypeForWarehouse(column.TypeModifier, datatypes.ClickHouseNumericCompatibility{}) return fmt.Sprintf("Decimal(%d, %d)", precision, scale), nil