-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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
planner: introduce hashEquals for expression.Column/collationInfo/fieldType #55691
planner: introduce hashEquals for expression.Column/collationInfo/fieldType #55691
Conversation
Signed-off-by: arenatlx <[email protected]>
Hi @AilinKid. Thanks for your PR. PRs from untrusted users cannot be marked as trusted with I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
Signed-off-by: arenatlx <[email protected]>
Signed-off-by: arenatlx <[email protected]>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #55691 +/- ##
=================================================
- Coverage 72.8618% 57.1825% -15.6793%
=================================================
Files 1582 1708 +126
Lines 442708 624421 +181713
=================================================
+ Hits 322565 357060 +34495
- Misses 100322 243734 +143412
- Partials 19821 23627 +3806
Flags with carried forward coverage won't be shown. Click here to find out more.
|
/test unit-test |
@AilinKid: Cannot trigger testing until a trusted user reviews the PR and leaves an In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
Signed-off-by: arenatlx <[email protected]>
Signed-off-by: arenatlx <[email protected]>
} | ||
|
||
// Equals implements the cascades/base.Hasher.<1th> interface. | ||
func (ft *FieldType) Equals(other any) bool { |
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.
This pattern is weird, why not define the signature as Equals(other *FieldType)
?
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.
its same for type downcast
say logicalProjection has one children stored as [child:logicalPlan]
when we want to check whether proj.child is equal to the other, we need to switch case to tell what it's children actual type is.
switch x := proj.child(type) {
case: logicalSelection:
y, ok := other.(logicalSelection)
if !ok {
return false
}
return x.Equals(other)
case ...
}
the type check is unavoidable, it depends on how you are ganna implement it, inside Equals or outside of it
[LGTM Timeline notifier]Timeline:
|
return false | ||
} | ||
for i, one := range ft.elems { | ||
if one != ft2.elems[i] { |
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.
do we need to consider collation 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.
no, Equals is called for double check after hash64 is the same for two obj. The semantic here should directly check whether this two ft are exactly the same, from the raw string is enough, "a" = "A" is not in consideration, otherwise, hash64 value won't be same if though
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.
But if you update the hash64
method to consider the collation, it is possible that under ci collation, two types with "a" and "A" are equal and have the same hash64. So the problem is, by you original definition and purpose, should we define enum type("a","b") equals to enum type("A","B") when collation is ci?
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.
“by you original definition and purpose, should we define enum type("a","b") equals to enum type("A","B") when collation is ci?”
this is not in consideration here, high-level equivalence is guaranteed by datum-compare liked infra, hash64 is based from the basic representation of data structure.
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
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: hawkingrei, tangenta, windtalker The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/retest-required |
@AilinKid: Cannot trigger testing until a trusted user reviews the PR and leaves an In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
/retest |
/retest-required |
@AilinKid: Cannot trigger testing until a trusted user reviews the PR and leaves an In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
/ok-to-test |
/test pull-mysql-client-test |
@AilinKid: The specified target(s) for
Use In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
/retest check-dev |
@AilinKid: The
The following commands are available to trigger optional jobs:
Use
In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/test check-dev |
@AilinKid: The
Use In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
@AilinKid: The specified target(s) for
Use In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
What problem does this PR solve?
Issue Number: ref #51664
Problem Summary:
What changed and how does it work?
Check List
Tests
Side effects
Documentation
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.