Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: hash-threshold should be compared with the number of values #121

Merged
merged 1 commit into from
Dec 9, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion sqllogictest/src/runner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -429,6 +429,10 @@ impl<D: AsyncDB> Runner<D> {
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) => {
Expand Down Expand Up @@ -504,7 +508,7 @@ impl<D: AsyncDB> Runner<D> {
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 {
Expand Down