WilliamWhispell opened a new pull request, #13451:
URL: https://github.com/apache/arrow/pull/13451
Currently you can reproduce this issue by reading a csv file with garbage
string values where float64 are expected. If you place the bad data in the
first part of the file, then subsequent r.r.Read() will clobber the parse err
that was set inside r.read(rec)
So at the bottom of the loop body, r.read(rec) is called, we end up in func
(r *Reader) parseFloat64(field array.Builder, str string)
it encounters an error, and sets err on the reader:
v, err := strconv.ParseFloat(str, 64)
if err != nil && r.err == nil {
r.err = err
field.AppendNull()
return
}
However, when we come back out of the call to the loop, we advance in the
for loop without checking the err and on the subsequent call to r.r.Read() we
clobber the r.err.
This means that if the last chunk has no error, after we read the csv, calls
to r.Err() on the reader will return nil, even though an err took place during
parse.
--
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]