Skip to content

Commit

Permalink
Support int32/int64 for float columns
Browse files Browse the repository at this point in the history
  • Loading branch information
nathan-artie committed Jun 14, 2024
1 parent 668c5d6 commit 1c1d30a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion clients/bigquery/storagewrite.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,12 @@ func rowToMessage(row map[string]any, columns []columns.Column, messageDescripto
message.Set(field, protoreflect.ValueOfFloat64(float64(value)))
case float64:
message.Set(field, protoreflect.ValueOfFloat64(value))
case int32:
message.Set(field, protoreflect.ValueOfFloat64(float64(value)))
case int64:
message.Set(field, protoreflect.ValueOfFloat64(float64(value)))
default:
return nil, fmt.Errorf("expected float32/float64 recieved %T with value %v", value, value)
return nil, fmt.Errorf("expected float32/float64/int32/int64 recieved %T with value %v", value, value)
}
case typing.EDecimal.Kind:
if decimalValue, ok := value.(*decimal.Decimal); ok {
Expand Down

0 comments on commit 1c1d30a

Please sign in to comment.