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

feat: Add concat operation to constraint streams #297

Merged
merged 13 commits into from
Oct 13, 2023

Conversation

Christopher-Chianelli
Copy link
Contributor

@Christopher-Chianelli Christopher-Chianelli commented Sep 29, 2023

The concat operation acts as an or between two constraint streams, propogating both stream tuples' downstream. It appears update/retract may be called before an insert, meaning the out tuple stored inside the in tuple is not set. As such, for update, if the out tuple is not set, it does an insert instead, and for retract, it simply ignores the operation.

Copy link
Contributor

@triceo triceo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!
I think we can still make the node itself more efficient.

Also, some minor comments. (Please make sure to apply them consistently in all cardinalities of streams.)

@Christopher-Chianelli
Copy link
Contributor Author

Christopher-Chianelli commented Oct 11, 2023

DONE: change text in image to use UNION ALL instead of OR (https://www.techonthenet.com/sql/union_all.php)

Christopher-Chianelli and others added 7 commits October 11, 2023 10:55
The concat operation acts as an or between two constraint streams,
propogating both stream tuples' downstream. It appears update/retract
may be called before an insert, meaning the out tuple stored inside
the in tuple is not set. As such, for update, if the out tuple is
not set, it does an insert instead, and for retract, it simply
ignores the operation.
Concat is more similar to UNION ALL than OR.
Co-authored-by: Lukáš Petrovický <lukas@petrovicky.net>
This also removes the "minimumNumberOfAssignmentsNoAssignments"
constraint since "minimumAndMaximumNumberOfAssignments" now
handles that case.
@Christopher-Chianelli Christopher-Chianelli marked this pull request as ready for review October 11, 2023 15:40
Copy link
Contributor

@triceo triceo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added the final set of comments as I re-read the docs.
I'll run my benchmarks overnight to see how it behaves, and then we can merge.

Co-authored-by: Lukáš Petrovický <lukas@petrovicky.net>
@triceo triceo added this to the 1.3.0 milestone Oct 11, 2023
Previously, concat did not update the content of the cloned tuples
in update. The `groupBy` and `map` building blocks both modify the contents
of their tuples instead of creating new ones. As a result, concat was
passing stale tuples with incorrect content downstream when placed
after a `groupBy` or `map` building block. Now, the contents of the
tuples are updated in update to prevent this issue.

Co-authored-by: Lukáš Petrovický <lukas@petrovicky.net>
@triceo triceo merged commit 0fef0c9 into TimefoldAI:main Oct 13, 2023
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants