Skip to content

Commit

Permalink
Merge branch '1.2-dev' into fix-support-pub
Browse files Browse the repository at this point in the history
  • Loading branch information
sukki37 authored Jun 4, 2024
2 parents 5cc7ca5 + ef6427d commit 399f9a4
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion pkg/frontend/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -850,7 +850,16 @@ func convertRowsIntoBatch(pool *mpool.MPool, cols []Column, rows [][]any) (*batc
case types.T_timestamp:
vData := make([]types.Timestamp, cnt)
for rowIdx, row := range rows {
vData[rowIdx] = row[colIdx].(types.Timestamp)
switch val := row[colIdx].(type) {
case types.Timestamp:
vData[rowIdx] = val
case string:
if vData[rowIdx], err = types.ParseTimestamp(time.Local, val, typ.Scale); err != nil {
return nil, nil, err
}
default:
return nil, nil, moerr.NewInternalErrorNoCtx("%v can't convert to timestamp type", val)
}
}
err := vector.AppendFixedList[types.Timestamp](bat.Vecs[colIdx], vData, nil, pool)
if err != nil {
Expand Down

0 comments on commit 399f9a4

Please sign in to comment.