From d753e4c77fbf00cdaab69477df2e9c3dba3f5fcc Mon Sep 17 00:00:00 2001 From: xxchan Date: Fri, 9 Dec 2022 08:37:11 +0100 Subject: [PATCH] fix: hash-threshold should be compared with the number of values (#121) --- sqllogictest/src/runner.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sqllogictest/src/runner.rs b/sqllogictest/src/runner.rs index a0c2461..b064b3c 100644 --- a/sqllogictest/src/runner.rs +++ b/sqllogictest/src/runner.rs @@ -429,6 +429,10 @@ impl Runner { self.validator = validator; } + pub fn with_hash_threshold(&mut self, hash_threshold: usize) { + self.hash_threshold = hash_threshold; + } + pub async fn apply_record(&mut self, record: Record) -> RecordOutput { match record { Record::Statement { conditions, .. } if self.should_skip(&conditions) => { @@ -504,7 +508,7 @@ impl Runner { Some(SortMode::ValueSort) => todo!("value sort"), }; - if self.hash_threshold > 0 && rows.len() > self.hash_threshold { + if self.hash_threshold > 0 && rows.len() * types.len() > self.hash_threshold { let mut md5 = md5::Context::new(); for line in &rows { for value in line {