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
Hash Join Issue? #61
Comments
Yep, you're right, nice find!
|
encountered this while playing around a little and wanted to to share in case it was helpful. I believe that this test should actually return duplicate results e.g.
(also just to reiterate, thanks for open sourcing this! it's great fun to play with) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi @erikgrinaker,
Thank you for open source this great project. I would like to say this is the best resource to learn database principles. Meanwhile, the code quality is awesome, neat and elegant. Every piece is excellent.
I have a question for one of the optimizer, as shown below:
when it is equal join, here we switch to hash join. based on Field(a) and Field(b). Not sure if I miss anything, but what if the corresponding field (column) are not unique ? if there are duplicate values in the fields. I feel the hash join will miss some rows?
The hash map is created by collect the key value pairs:
let right: HashMap<Value, Row> = rrows
.map(|res| match res {
Ok(row) if row.len() <= r => {
Err(Error::Internal(format!("Right index {} out of bounds", r)))
}
Ok(row) => Ok((row[r].clone(), row)),
Err(err) => Err(err),
})
.collect::<Result<_>>()?;
if there are duplicate values, I think only the last pair will exist.
do I miss anything? Appreciate any feedback. Thanks!
The text was updated successfully, but these errors were encountered: