-
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: support expression reverse evaluation framework #13738
expression: support expression reverse evaluation framework #13738
Conversation
expression/column.go
Outdated
|
||
// ReverseEvalDuration evaluates the only one column duration value with given function result. | ||
func (col *Column) ReverseEvalDuration(res types.Datum, rType RoundingType) (val types.Duration, err error) { | ||
return res.GetMysqlDuration(), errors.Errorf("Constant.ReverseEvalDuration() should never be called, please contact the TiDB team for help") |
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.
Why return error for them?
f07c752
to
e8de681
Compare
Codecov Report
@@ Coverage Diff @@
## master #13738 +/- ##
===========================================
Coverage 80.3523% 80.3523%
===========================================
Files 480 480
Lines 119699 119699
===========================================
Hits 96181 96181
Misses 16007 16007
Partials 7511 7511 |
3e841bd
to
bae37fd
Compare
8b5de09
to
185f2e9
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.
Can you add some unit tests?
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
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
Your auto merge job has been accepted, waiting for 13827 |
/run-all-tests |
@lzmhhh123 merge failed. |
/merge |
/run-all-tests |
What problem does this PR solve?
A sub PR of #13659
Now, we only support reverse evaluation for expression type
int
,float
,decimal
. Because other types' reverse evaluations are very complex.What is changed and how it works?
Add the framework of the reverse evaluation for expression.
Check List
Tests
Code changes
Side effects