diff --git a/pkg/s3select/csv/reader.go b/pkg/s3select/csv/reader.go index bdf24d922..605aee9aa 100644 --- a/pkg/s3select/csv/reader.go +++ b/pkg/s3select/csv/reader.go @@ -106,8 +106,8 @@ func (r *Reader) Read(dst sql.Record) (sql.Record, error) { func (r *Reader) Close() error { if r.close != nil { close(r.close) - r.close = nil r.readerWg.Wait() + r.close = nil } r.recordsRead = len(r.current) if r.err == nil {