Expand description
Bytes into fields.
One function, which reads one record. It is separate from the reader above it because the sniffer runs it too: working out the delimiter means splitting the sample under each candidate and seeing which one gives every line the same number of fields, and that has to be the same splitting the reader will do or the sniffer answers a question nobody asked.
A record ends at a newline that is not inside a quoted field, and the three line endings are all accepted whatever the file mostly uses. DuckDB reports the one it found and reads either, and a file that a text editor has half converted is a real thing.
Fields arrive as owned strings. That is a copy per field and it is the wrong shape for a fast scan, which wants a range into the buffer and a copy only for the fields that had an escape in them. The borrowed form is the change to make when there is a number saying it matters, and it is a change to this one function.
Functionsยง
- record
- Reads the record starting at
fromintoout, and answers where the next one starts.