handle float --> stringset implicit map conversion in bulk insert (#2211)

Co-authored-by: Fletcher Haynes <fletcher.haynes@generalassemb.ly>
This commit is contained in:
Pat Okeeffe 2023-01-23 16:18:46 -06:00 • committed by GitHub
parent f6baf32dbd
commit 3606167758
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -593,7 +593,11 @@ func (i *bulkInsertSourceNDJsonRowIter) Next(ctx context.Context) (types.Row, er
case *parser.DataTypeStringSet:
switch v := evalValue.(type) {
case float64:
return nil, sql3.NewErrTypeConversionOnMap(0, 0, v, mapColumn.colType.TypeDescription())
if v == float64(int64(v)) {
result[idx] = []string{fmt.Sprintf("%d", int64(v))}
} else {
result[idx] = []string{fmt.Sprintf("%f", v)}
}
case []interface{}:
setValue := make([]string, 0)