-
Notifications
You must be signed in to change notification settings - Fork 44
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
feat: Add typeIndexJoin
explainable attributes.
#499
feat: Add typeIndexJoin
explainable attributes.
#499
Conversation
Codecov Report
@@ Coverage Diff @@
## develop #499 +/- ##
===========================================
+ Coverage 54.20% 54.32% +0.11%
===========================================
Files 97 97
Lines 13109 13158 +49
===========================================
+ Hits 7106 7148 +42
- Misses 5328 5331 +3
- Partials 675 679 +4
|
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.
Approved with a couple of non-blocking comments that would be good to get replies on. Looks good.
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.
Just need to add in the subType
plan so both the root and the subtype scannodes show up.
9bd91b6
to
1dcd00e
Compare
1dcd00e
to
01a0b0e
Compare
Also Restructure root and subType explain graphs.
01a0b0e
to
80241c8
Compare
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.
Mostly looking great!
One weird thing I noticed in the typeIndexJoin
attributes for the subType
field. It's returning a selectTopNode
without an innter selectNode
, and instead goes straight into the next node, eg scanNode
or another typeIndexJoin
, etc.
I'm not sure if this is a problem in the explain code or the planner itself, but based on my review, the planner just called planner.SubSelect
when making the subTypes, which just calls planner.Select
but deletes the render step (since we do that at the end).
Let me know what you think after looking into it, and ping me if you need some insight/help.
} | ||
|
||
// Add the attribute(s). | ||
explainerMap[joinRootLabel] = joinType.subTypeFieldName |
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.
unrelated to this PR, I guess we have some naming inconsistencies here w.r.t subTypeFieldNam
actually coorepsonding to joinRootLabel
.
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.
shouldn't subTypeFieldName
just be renamed to rootName
? or am I missing something here?
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.
I think so. Trying to remember why it wasn't. Either way independant of this PR, so we don't need to resolve it atm
}, | ||
}, | ||
|
||
Results: []dataMap{ |
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.
praise: The effort that went into all these test cases is 👌 * chefs kiss *
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.
Gracias amigo!
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.
LGTM!
- RELEVANT ISSUE(S) Resolves sourcenetwork#475 - DESCRIPTION Add the remaining attributes for `typeIndexJoin` node that we want to see in the explainable response. Example: Request: ``` query @Explain { author { _key name contact { email address { city } } } } ``` Response: ``` { "explain": { "selectTopNode": { "renderNode": { "selectNode": { "filter": nil "typeIndexJoin": { "joinType": "typeJoinOne" "direction": "primary" "rootName": "author" "root": { "scanNode": { "filter": nil "collectionID": "3" "collectionName": "author" "spans": []{ { "start": "/3" "end": "/4" } } } } "subTypeName": "contact" "subType": { "selectTopNode": { "selectNode": { "filter": nil "typeIndexJoin": { "joinType": "typeJoinOne" "direction": "primary" "rootName": "contact" "root": { "scanNode": { "filter": nil "collectionID": "4" "collectionName": "authorContact" "spans": []{ { "start": "/4" "end": "/5" } } } } "subTypeName": "address" "subType": { "selectTopNode": { "selectNode": { "filter": nil "scanNode": { "filter": nil "collectionID": "5" "collectionName": "contactAddress" "spans": []{ { "start": "/5" "end": "/6" } } } } } } } } } } } } } } } } ```
RELEVANT ISSUE(S)
Resolves #475
DESCRIPTION
Add the remaining attributes for
typeIndexJoin
node that we want to see in the explainable response.Example:
Request:
Response:
HOW HAS THIS BEEN TESTED?
Added integration tests.
ENVIRONMENT / OS THIS WAS TESTED ON?
Please specify which of the following was this tested on (remove or add your own):