-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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 retrieval of facets with cascade #4530
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 2 of 2 files at r1.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @ashish-goswami)
query/query_facets_test.go, line 1134 at r1 (raw file):
} func TestFacetsCascadeScalarPredicate(t *testing.T) {
Add another case where cascade removes one of the results. Facets should be retrieved for the other uid.
query/query_facets_test.go, line 1176 at r1 (raw file):
js := processQueryNoErr(t, query) fmt.Println(js)
remove
query/query_facets_test.go, line 1225 at r1 (raw file):
populateClusterWithFacets() query := `{ q(func: uid(1, 23)) @cascade {
Can remove top level cascade or add another case where cascade is only applied on child.
There was a problem hiding this 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, 3 unresolved discussions (waiting on @pawanrawal)
query/query_facets_test.go, line 1134 at r1 (raw file):
Previously, pawanrawal (Pawan Rawal) wrote…
Add another case where cascade removes one of the results. Facets should be retrieved for the other uid.
updated TestFacetsCascadeUIDPredicate
to have uid 24
also. This uid has name
, but doesn't have friend
, hence it should not be retrieved.
query/query_facets_test.go, line 1176 at r1 (raw file):
Previously, pawanrawal (Pawan Rawal) wrote…
remove
Done.
query/query_facets_test.go, line 1225 at r1 (raw file):
Previously, pawanrawal (Pawan Rawal) wrote…
Can remove top level cascade or add another case where cascade is only applied on child.
Removed top level cascade.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 2 of 2 files at r2.
Reviewable status: complete! all files reviewed, all discussions resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 2 of 2 files at r2.
Reviewable status: complete! all files reviewed, all discussions resolved
Fixes #4310
Currently we are not able to fetch
fecets
associated with scalar predicate when usingcascade
directive.While processing
cascade
directive, we updateuidMatrix
. Everyuid
inuidMatrix
is checked ifit is present in
destUIDs
, if not we remove it fromuidMatrix
. We also remove entry fromfacetsMatrix
for sameuid
. This works fine when predicate is ofuid/[uid]
type.When predicate is of scalar type,
destUIDs
anduidMatrix
will be empty, hence we should notupdate
facetsMatrix
as facets here are corresponding tovalueMatrix
.This PR avoid updating
facetsMatrix
when a uid list inuidMatrix
is empty inupdateUidMatrix
.This change is