Closed roker closed 5 years ago
Workaround until fixed, it works but it is annoying. x as count( entry.x ) y as count( entry.y ) sub1 : math( x - y ) workaround1 : entry.x @filter(uid( "0x4e3" )) workaround2 : entry.y @filter( uid( "0x4e3" )) x1 as count(workaround1) y1 as count(workaround2) sum1 : math( x1 + y1 )
This can be done by using blocks.
{
var(func: anyofterms(name@en, "Blade Runner")) {
uid
x1 as count(name@en)
}
var(func: anyofterms(name@en, "Blade Runner")) {
uid
x2 as count(name@en @filter(uid(0x27156)))
}
q(func: uid(x1, x2)) {
sub1: math(x1 - x2)
sum1: math(x1 + x2)
}
}
This is the same issue as https://github.com/dgraph-io/dgraph/issues/921 by using different operation.
`root@www:/dgraph # ./dgraph version
Dgraph version : Commit SHA-1 : Commit timestamp : Branch : `
Have you tried reproducing the issue with latest release? Yes. And the one from 6th of July
What is the hardware spec (RAM, OS)? FreeBSD (reproducable on linux too), since it is a test machine, i gave dgraph 1Gb of RAM
Steps to reproduce the issue (command/config used to run Dgraph). x as count( entry.x ) y as count( entry.y ) sub1 : math( x - y ) x1 as count(entry.x @filter(uid( "0x4e3" ))) y1 as count(entry.y @filter( uid( "0x4e3" ))) sum1 : math( x1 + y1 )
Expected behaviour and actual result. Expected: It should work. Actual: Error, entry.xcount not allowed multiple times in same sub-query