-
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
expression,planner/core: support unix_timestamp() function in partition pruning #12035
Conversation
Codecov Report
@@ Coverage Diff @@
## master #12035 +/- ##
===========================================
Coverage 81.3689% 81.3689%
===========================================
Files 453 453
Lines 97289 97289
===========================================
Hits 79163 79163
Misses 12468 12468
Partials 5658 5658 |
Related issue #12028 |
/run-common-test |
} | ||
|
||
func newTimestamp(yy, mm, dd, hh, min, ss int) *Constant { | ||
return newTimeConst(yy, mm, dd, hh, min, ss, mysql.TypeTimestamp) |
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.
The arguments hh, min, ss
dosen't use in the newTimeConst
function, why still pass them into the function??
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.
A timestamp value has the hh, min, ss
part, while a date value contains only the yy, mm, dd
information. That's why the newDate
function has fewer parameters than newTimestamp
.
We pass 0 as arguments, but it doesn't means hh, min, ss
would never be useful in the future.
@fatpa
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. Please fix CI.
/run-all-tests |
/rebuild |
1 similar comment
/rebuild |
/run-sqllogic-test-1 |
/run-integration-compatibility-test |
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 11702, 12150 |
/run-all-tests |
@tiancaiamao merge failed. |
/run-unit-test |
/run-all-tests |
cherry pick to release-3.0 failed |
@tiancaiamao Do we need to cherry pick this one to release-3.1? |
It seems that, not for sure, we failed to cherry-pick this commit to release-3.0. Please comment '/run-cherry-picker' to try to trigger the cherry-picker if we did fail to cherry-pick this commit before. @tiancaiamao PTAL. |
What problem does this PR solve?
Expected:
Get:
Partition pruning doesn't work using the
unix_timestamp()
function.What is changed and how it works?
Add
unix_timestamp
to monotoneIncFuncs list.We can infer the rule
f(x) > xxx and x < yyy
if f is monotonously increasing.Check List
Tests