-
Notifications
You must be signed in to change notification settings - Fork 109
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
ConstraintStreams: accumulate or outer right join #1399
Comments
Can we use complement instead?
|
Proposal C) forEach(Rule).join(Tri<...>) Proposal D)
|
Proposal E)
This has a buggy count: Rules:
=> Monday Ann count is 2 Fix: E1)
Con:
|
record Rule(teacher, day, minimumCount) F) forEach(Lesson) Risky: this presumes that the compelentBi is a complete set, such that inner join with rule will not rule out any rules (pun intended) |
G) Accumulate
Philosophy: the user does not have to define the default (zero) value for a collector. |
G1) Builder pattern
Also fixes the groupBy compiler struggles:
|
Currently Lukas and me like the accumulate idea a lot more because it is a more useful building block |
This pattern is common:
It's also buggy. If nothing is assigned to the grouping, the MinMaxRule isn't checked.
This is because join() is an inner join in SQL talk. We need an outer right join instead.
Some models have helper code for that:
Let's standardize it.
Proposal A)
Add syntactic sugar + tests for
Uni/Bi/Tri/QuadConstraintStream.joinOuterRight(...)
, as shown above.Later implementations can potentially optimize the implementation, but for now the facade is enough.
Naming to be discussed.
Later we might want to implement a left outer join (
.joinOuterLeft()
) and a full outer join (.joinOuterFull()
) too.The text was updated successfully, but these errors were encountered: