-
Notifications
You must be signed in to change notification settings - Fork 2.4k
[CALCITE-3458] Remove desc in AbstractRelNode #1546
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
Conversation
return desc; | ||
StringBuilder sb = new StringBuilder("rel#"); | ||
sb = sb.append(id).append(':').append(digest); | ||
return sb.toString(); |
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.
If this is called before recomputeDigest(), we will get a different description string than the original implementation. Is that you want?
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.
Yes. That is expected.
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'm wondering if we can add a benchmark test for the toString with/without the fix.
If the query is super large, e.g. contains tens of thousands of nodes or expressions, the RelNode digest and desc become very large. The content of desc and digest are almost the same, except that desc consists of id plus digest. So remove desc, just use id + digest to produce description.
// Same with {@link rel#getDescription()}, we don't call it explicitly | ||
// in order to avoid string copy when generating description. | ||
buf.append("rel#").append(rels[i].getId()) | ||
.append(':').append(rels[i].getDigest()); |
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.
Can we abstract this description as a tool method and reuse that ? Something like RelOptUtil#generatesDescription(StringBuilder builder, int relNodeID, String digest)
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.
Sounds good. I have addressed your comments.
LGTM |
If the query is super large, e.g. contains tens of thousands of nodes or expressions, the RelNode digest and desc become very large. The content of desc and digest are almost the same, except that desc consists of id plus digest. So remove desc, just use id + digest to produce description. Also deprecated method rel.getDescription(), use rel.toString() instead. Close apache#1546
If the query is super large, e.g. contains tens of thousands of nodes or expressions, the RelNode digest and desc become very large. The content of desc and digest are almost the same, except that desc consists of id plus digest. So remove desc, just use id + digest to produce description. Also deprecated method rel.getDescription(), use rel.toString() instead. Close apache#1546
If the query is super large, e.g. contains tens of thousands of nodes or expressions, the RelNode digest and desc become very large. The content of desc and digest are almost the same, except that desc consists of id plus digest. So remove desc, just use id + digest to produce description. Also deprecated method rel.getDescription(), use rel.toString() instead. Close apache#1546
If the query is super large, e.g. contains tens of thousands of nodes or expressions, the RelNode digest and desc become very large. The content of desc and digest are almost the same, except that desc consists of id plus digest. So remove desc, just use id + digest to produce description. Also deprecated method rel.getDescription(), use rel.toString() instead. Close apache#1546
If the query is super large, e.g. contains tens of thousands of nodes or
expressions, the RelNode digest and desc become very large. The content of desc
and digest are almost the same, except that desc consists of id plus digest. So
remove desc, just use id + digest to produce description.
https://issues.apache.org/jira/browse/CALCITE-3458