zeroshade commented on code in PR #34343:
URL: https://github.com/apache/arrow/pull/34343#discussion_r1128282068


##########
go/arrow/csv/reader.go:
##########
@@ -721,6 +726,32 @@ func (r *Reader) parseDecimal256(field array.Builder, str 
string, prec, scale in
        field.(*array.Decimal256Builder).Append(val)
 }
 
+func (r *Reader) parseList(field array.Builder, str string) {
+       if r.isNull(str) {
+               field.AppendNull()
+               return
+       }
+       if !(strings.HasPrefix(str, "{") || strings.HasSuffix(str, "}")) {
+               r.err = errors.New("invalid list format. should start with '{' 
and end with '}'")
+               field.AppendNull()
+               return
+       }
+       str = strings.TrimPrefix(str, "{")
+       str = strings.TrimSuffix(str, "}")
+       listBldr := field.(*array.ListBuilder)
+       listBldr.Append(true)
+       valueBldr := listBldr.ValueBuilder()
+       reader := csv.NewReader(strings.NewReader(str))
+       items, err := reader.Read()
+       if err != nil {
+               r.err = err
+               return
+       }
+       for _, str := range items {
+               r.initFieldConverter(valueBldr)(str)
+       }

Review Comment:
   a future enhancement might be to cache this somehow... but it's not needed 
for this PR



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to