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: skip parallel merge nodes when selecting the result name #4567

Merged
merged 1 commit into from
Mar 16, 2022

Conversation

adrian-thurston
Copy link
Contributor

If a node is a parallel merge then it was added by the planner and might be a
successor of a node with side effects. In order to preserve behaviour, skip
these parallel merge nodes and check if the predecessor has side effects. If
so, use that node name instead.

Done checklist

  • docs/SPEC.md updated
  • Test cases written

@adrian-thurston adrian-thurston requested a review from a team as a code owner March 16, 2022 23:01
@adrian-thurston adrian-thurston requested review from onelson and removed request for a team March 16, 2022 23:01
@adrian-thurston adrian-thurston self-assigned this Mar 16, 2022
… effects

If a node is a parallel merge then it was added by the planner and might be a
successor of a node with side effects. In order to preserve behaviour, skip
these parallel merge nodes and check if the predecessor has side effects. If
so, use that node name instead.
Copy link
Contributor

@onelson onelson left a comment

Choose a reason for hiding this comment

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

lgtm! :shipit:

// of a side-effect result; skip them.
if isParallelMerge {
if len( node.Predecessors() ) != 1 {
return "", errors.New(codes.Internal, "parallel merge must have a single predecessor")
Copy link
Contributor

Choose a reason for hiding this comment

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

I think you mentioned possibly being able to enforce this during planning. The check here should probably be here regardless, but I'm wondering if there'll be a follow-on to this follow-on.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, was planning on adding to the planner attributes a way to say that the node with the attribute must have at least one successor, or that it must have at least one predecessor.

@adrian-thurston adrian-thurston merged commit d8ccde2 into master Mar 16, 2022
@jacobmarble jacobmarble deleted the fix/skip-merge-result-name branch January 4, 2024 16:50
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