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

Allow the result of count(uid) to be assigned to a var. #2947

Merged
merged 3 commits into from
Jan 30, 2019

Conversation

martinmr
Copy link
Contributor

@martinmr martinmr commented Jan 29, 2019

Allow expressions of the form "f as count(uid)".

When resolving the value of such a variable inside a math block it gets
treated as a constant.


This change is Reviewable

Allow expressions of the form "f as count(uid)".

When resolving the value of such a variable inside a math block it gets
treated as a constant.
@martinmr martinmr requested a review from manishrjain January 29, 2019 01:54
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: Looks good. Just remove the glog.Infof.

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


query/query.go, line 1505 at r1 (raw file):

		}

		glog.Infof("value %v", int64(len(sg.DestUIDs.Uids)))

Don't add logs in query execution paths. They can get very expensive.

Copy link
Contributor

@srfrog srfrog 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, 1 unresolved discussion (waiting on @manishrjain)


query/query.go, line 1505 at r1 (raw file):

Previously, manishrjain (Manish R Jain) wrote…

Don't add logs in query execution paths. They can get very expensive.

oops actually that was a debug check. thanks for noticing

Copy link
Contributor

@srfrog srfrog 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, 1 unresolved discussion (waiting on @manishrjain)

Copy link
Contributor Author

@martinmr martinmr 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, 1 unresolved discussion (waiting on @manishrjain)


query/query.go, line 1505 at r1 (raw file):

Previously, srfrog (Gus) wrote…

oops actually that was a debug check. thanks for noticing

Done. Thanks for catching this, this was just a debug check.

@martinmr martinmr merged commit 64c681a into master Jan 30, 2019
@martinmr martinmr deleted the martinmr/count-uid-as-var branch January 30, 2019 20:03
dna2github pushed a commit to dna2fork/dgraph that referenced this pull request Jul 19, 2019
Allow expressions of the form "f as count(uid)".

When resolving the value of such a variable inside a math block it gets
treated as a constant.
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.

3 participants