-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
expression: correct the erroneous scalar function equivalence check #54067
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #54067 +/- ##
=================================================
- Coverage 72.8694% 55.9676% -16.9018%
=================================================
Files 1516 1636 +120
Lines 434812 605410 +170598
=================================================
+ Hits 316845 338834 +21989
- Misses 98407 243332 +144925
- Partials 19560 23244 +3684
Flags with carried forward coverage won't be shown. Click here to find out more.
|
pkg/expression/scalar_function.go
Outdated
@@ -365,6 +365,9 @@ func (sf *ScalarFunction) Equal(ctx EvalContext, e Expression) bool { | |||
if sf.FuncName.L != fun.FuncName.L { | |||
return false | |||
} | |||
if sf.GetType(ctx) != fun.GetType(ctx) { |
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 compare *FieldType directly?
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, I have updated.
e12f627
to
47accc1
Compare
/retest |
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
[LGTM Timeline notifier]Timeline:
|
pkg/expression/scalar_function.go
Outdated
@@ -365,6 +365,9 @@ func (sf *ScalarFunction) Equal(ctx EvalContext, e Expression) bool { | |||
if sf.FuncName.L != fun.FuncName.L { | |||
return false | |||
} | |||
if sf.RetType != fun.RetType { |
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 compare 2 pointers directly?
/hold |
/unhold |
/test all |
Signed-off-by: Weizhen Wang <[email protected]>
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: lcwangchao, qw4990, tangenta, windtalker, wshwsh12 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 |
/cherrypick release-8.1 |
@hawkingrei: new pull request created to branch 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 ti-community-infra/tichi repository. |
Signed-off-by: ti-chi-bot <[email protected]>
Signed-off-by: ti-chi-bot <[email protected]>
@hawkingrei: new pull request created to branch 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 ti-community-infra/tichi repository. |
@hawkingrei: new pull request created to branch 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 ti-community-infra/tichi repository. |
Signed-off-by: ti-chi-bot <[email protected]>
In response to a cherrypick label: new pull request created to branch |
Signed-off-by: ti-chi-bot <[email protected]>
What problem does this PR solve?
Issue Number: close #53726
Problem Summary:
What changed and how does it work?
when planer call
RemoveUnnecessaryFirstRow
. it will check the expression betweenAgg
andGroupBy
. but it doesn't check the return type. so it get wrong unnecessaryFirstRow
.Check List
Tests
Side effects
Documentation
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.