Skip to content

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

Merged
martinmr merged 3 commits intomasterfrom
martinmr/count-uid-as-var
Jan 30, 2019
Merged

Allow the result of count(uid) to be assigned to a var.#2947
martinmr merged 3 commits intomasterfrom
martinmr/count-uid-as-var

Conversation

@martinmr
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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