-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Closed
Labels
area/querylangIssues related to the query language specification and implementation.Issues related to the query language specification and implementation.kind/enhancementSomething could be better.Something could be better.priority/P2Somehow important but would not block a release.Somehow important but would not block a release.status/acceptedWe accept to investigate/work on it.We accept to investigate/work on it.
Description
What version of Dgraph are you using?
v1.0.17
Have you tried reproducing the issue with the latest release?
On your site. I ran this (and reproduced) on website with the blade runner example
What is the hardware spec (RAM, OS)?
MBP 2017 16GB Ram, running inside docker
Steps to reproduce the issue (command/config used to run Dgraph).
{
bladerunner(func: eq(name@en, "Blade Runner")) {
uid
name@en
initial_release_date
netflix_id
youDontHaveThisEdge {
B as count(~provideTag)
}
mediaCount: sum(val(B))
}
}
Expected behaviour and actual result.
Expected behaviour:
mediaCount should be 0
actual results:
Notice that mediaCount is absent from the response
{
"data": {
"bladerunner": [
{
"uid": "0x394c",
"name@en": "Blade Runner",
"initial_release_date": "1982-06-25T00:00:00Z",
"netflix_id": "70083726",
}
]
}
}
My current workaround:
{
bladerunner(func: eq(name@en, "Blade Runner")) {
uid
name@en
initial_release_date
netflix_id
youDontHaveThisEdge {
B as count(~provideTag)
}
mediaCount as mediaCount: sum(val(B))
mathZero as math(0)
mediaCount2: math( max(mediaCount, mathZero) )
}
}
which returns:
{
"data": {
"bladerunner": [
{
"uid": "0x394c",
"name@en": "Blade Runner",
"initial_release_date": "1982-06-25T00:00:00Z",
"netflix_id": "70083726",
"val(mathZero)": 0,
"mediaCount2": 0
}
]
}
}
Keep in mind, I also got forced to make a variable 'math(0)' which seems like another bug, I can't put max( , 0), it returns nothing. If this is a different bug you can reproduce it with the above command as well.
Metadata
Metadata
Assignees
Labels
area/querylangIssues related to the query language specification and implementation.Issues related to the query language specification and implementation.kind/enhancementSomething could be better.Something could be better.priority/P2Somehow important but would not block a release.Somehow important but would not block a release.status/acceptedWe accept to investigate/work on it.We accept to investigate/work on it.