pub struct Given {
pub delimiter: Option<u8>,
pub quote: Option<u8>,
pub escape: Option<u8>,
pub header: Option<bool>,
}Expand description
What the caller said about how the file is written, where the sniffer would otherwise decide.
Every field is optional and a None means nothing was said, which is the common case and is the
one the sniffer is for. What is given is not sniffed: read_csv('f.csv', delim=';') does not try
the four candidates and pick one, it uses the semicolon, and a file that is really comma
separated then comes back as one column. That is DuckDB’s behaviour and it is the useful one,
since somebody who wrote the delimiter down knows something the first megabyte of the file does
not say.
A given value also changes the block DuckDB prints under a conversion error, where a line reads
(Set By User) rather than (Auto-Detected), which is why this is carried into the reader
rather than folded into a Dialect and forgotten.
Fields§
§delimiter: Option<u8>The byte between two fields.
quote: Option<u8>The byte that opens and closes a field.
escape: Option<u8>The byte that makes the next quote a literal one.
header: Option<bool>Whether the first line names the columns.