-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
[CALCITE-6852] Project's digest calculation error, should include FieldNames in rowType #4208
base: main
Are you sure you want to change the base?
Conversation
@@ -362,7 +362,8 @@ protected boolean deepEquals0(@Nullable Object obj) { | |||
|
|||
@API(since = "1.24", status = API.Status.INTERNAL) | |||
protected int deepHashCode0() { | |||
return Objects.hash(traitSet, input.deepHashCode(), exps, hints); | |||
return Objects.hash(traitSet, input.deepHashCode(), |
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.
does this match what happens for other operators?
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.
does this match what happens for other operators?
@mihaibudiu Perhaps other operators need to check the deepHashCode0. But the original deepHashCode0 of the project may lead to incorrect choices. This change may expose errors in two rules, but I have fixed them.
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.
There are two reasons to check what is done in other similar places:
- if this is a bug, we should try to find out whether the bug appears in other places so we can fix it. Not in this PR, but at least we can file a new issue about it.
- if no other place checks field names, perhaps the intent of the digest is to ignore field names, and then maybe the bug is elsewhere
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.
Note that I personally don't know what the intent of the digest is.
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.
Note that I personally don't know what the intent of the digest is.
please see this issue: https://issues.apache.org/jira/projects/CALCITE/issues/CALCITE-6852
…ldNames in rowType
fdb23f0
to
692f122
Compare
|
I saw the issue, and I agree that there is a bug, but the question I am asking is whether this is the bug or the bug is elsewhere. |
@mihaibudiu OK, I think this is indeed a summary calculation problem of the project. The corresponding relationship between the operator and Vertex will be recorded in mapDigestToVertex, which makes it easy to retrieve the corresponding operator in findBestExp. If the Project loses the field name information during calculation, it will be deduplicated by map and replaced by a project with the same field but only a different alias. This may depend on the order of the put operators. As for other operators, the only one I can think of is agg, because only operators with column clipping may be involved in this problem, but generally agg will have a project on it, so the overall plan may be fine. |
Hi, @mihaibudiu , I have added another part of the problem explanation. Please take a look at this CALCITE-6852 again |
It seems to me that this comment in
|
@rubenada Yes, the problem should arise here, missing aliases is a very serious problem. But we can't modify this, it will cause a big change in behavior. |
No description provided.