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 bug, aggregate value var works with blank node in upsert #4767

Merged
merged 1 commit into from
Mar 4, 2020

Conversation

mangalaman93
Copy link
Contributor

@mangalaman93 mangalaman93 commented Feb 13, 2020

Fixes #4712


This change is Reviewable

Copy link
Contributor

@harshil-goel harshil-goel left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewable status: 0 of 2 files reviewed, all discussions resolved (waiting on @harshil-goel, @manishrjain, and @martinmr)

Copy link
Contributor

@MichelDiz MichelDiz left a comment

Choose a reason for hiding this comment

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

Reviewable status: 0 of 2 files reviewed, 1 unresolved discussion (waiting on @mangalaman93, @manishrjain, and @martinmr)


dgraph/cmd/alpha/upsert_test.go, line 2818 at r1 (raw file):

    me() {
      sVerIncr as sum(val(VerIncr))

This PR has been tested and works perfectly. However, I have a concern about this usage. We should eliminate the empty block from this procedure, as it was not created for this and can lead to future problems.

However, it is not a blocking for me. It's just a concern. We can merge it. But it would not be a definitive solution to issue 4767. In terms of practicality and future issues.

Copy link
Contributor

@manishrjain manishrjain left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewed 2 of 2 files at r1.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @mangalaman93 and @martinmr)


edgraph/server.go, line 476 at r1 (raw file):

// If val(variable) exists in a query, but the values are not there for the variable,
// it will ignore the mutation silently.
func updateValInNQuads(nquads []*api.NQuad, qc *queryContext, isSet bool) []*api.NQuad {

Don't need isSet, unless Dgraph would complain about this.

Copy link
Contributor Author

@mangalaman93 mangalaman93 left a comment

Choose a reason for hiding this comment

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

Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @manishrjain, @martinmr, and @MichelDiz)


dgraph/cmd/alpha/upsert_test.go, line 2818 at r1 (raw file):

Previously, MichelDiz (Michel Conrado) wrote…

This PR has been tested and works perfectly. However, I have a concern about this usage. We should eliminate the empty block from this procedure, as it was not created for this and can lead to future problems.

However, it is not a blocking for me. It's just a concern. We can merge it. But it would not be a definitive solution to issue 4767. In terms of practicality and future issues.

It doesn't solve the whole problem, agreed.


edgraph/server.go, line 476 at r1 (raw file):

Previously, manishrjain (Manish R Jain) wrote…

Don't need isSet, unless Dgraph would complain about this.

Turns out Dgraph complains.

Copy link
Contributor

@MichelDiz MichelDiz left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewed 2 of 2 files at r1.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @manishrjain and @martinmr)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

It is not possible to create a new node from another using Upsert Block
4 participants