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

Degenerate natural semijoin and antijoin should produce output instead of error #13

Closed
apjanke opened this issue Mar 2, 2019 · 2 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@apjanke
Copy link
Owner

apjanke commented Mar 2, 2019

The degenerate cases of natural semijoin and antijoin where they have no variable names in common probably have a correct output, so they should produce output instead of error like they do now.

I think it's the case that:
a) The degenerate case of JOIN is the cartesian product (all rows in A match all rows in B).
b) Thus, the degenerate case of semijoin should be that all rows in the inputs are kept.
c) And thus, the degenerate case of antijoin should be the empty set, because antijoin is simply the inverse of the results of semijoin.
But I need to verify that.

@apjanke apjanke changed the title Degenerate natural semijoin and semidiff Degenerate natural semijoin and semidiff should produce output instead of error Mar 2, 2019
@apjanke apjanke self-assigned this Mar 2, 2019
@apjanke apjanke added the bug Something isn't working label Mar 2, 2019
@apjanke apjanke added this to the 1.0 milestone Mar 2, 2019
@apjanke apjanke mentioned this issue Mar 2, 2019
58 tasks
@apjanke apjanke changed the title Degenerate natural semijoin and semidiff should produce output instead of error Degenerate natural semijoin and antijoin should produce output instead of error Mar 2, 2019
@apjanke
Copy link
Owner Author

apjanke commented May 1, 2019

Okay, looking at https://en.wikipedia.org/wiki/Relational_algebra#Semijoin_(%E2%8B%89)(%E2%8B%8A), the predicate is a "for all", and "for all" degenerates to true in the case of no things. So, yeah, degenerate semijoin should be the input, and degenerate antijoin should be empty.

@apjanke
Copy link
Owner Author

apjanke commented May 1, 2019

Fixed in 97e7cab.

@apjanke apjanke closed this as completed May 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant