From 5b4834115b2d2d12670b235fe6c39f226930505d Mon Sep 17 00:00:00 2001 From: Phil Date: Mon, 29 Jan 2024 11:18:05 -0500 Subject: [PATCH] parser: increase prefix length used for detection of CSV dialect When detecting the CSV dialect, our results will get more accurate the more data we look at. The previous value of 8KiB would sometimes only allow us to look at one or two rows if the CSV was very wide. Wide CSVs are pretty common in practice, so this increases that prefix in order to give our dialect detection a better shot at success. --- crates/parser/src/format/character_separated/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/parser/src/format/character_separated/mod.rs b/crates/parser/src/format/character_separated/mod.rs index c0ac007f78..ef73e1b6a8 100644 --- a/crates/parser/src/format/character_separated/mod.rs +++ b/crates/parser/src/format/character_separated/mod.rs @@ -25,7 +25,7 @@ struct CsvParser { config: AdvancedCsvConfig, } -const PEEK_PREFIX_LEN: usize = 8096; +const PEEK_PREFIX_LEN: usize = 1 << 16; // 64KiB impl Parser for CsvParser { fn parse(&self, content: Input) -> Result {