westonpace commented on issue #34282:
URL: https://github.com/apache/arrow/issues/34282#issuecomment-1439176799
I think this could be potentially expensive on large CSV files:
```
#full data with new columns in header
dat = l1+b'\n'+l2+b'\n'+dat
```
Instead, how about:
* Open file, read first two lines, calculate headers (as you do today)
* Close file
* Call `read_csv` but set `skip_rows` to 2 and provide `column_names` so
that it doesn't look for a header row.
This will cause the first two lines of the file to be read twice but that
should be pretty cheap.
--
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]