-
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: round the frac part for ParseTimeFromFloat64
#56340
Conversation
Hi @gengliqi. 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. |
/check-issue-triage-complete |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #56340 +/- ##
================================================
+ Coverage 72.8488% 73.4178% +0.5689%
================================================
Files 1672 1672
Lines 462666 463709 +1043
================================================
+ Hits 337047 340445 +3398
+ Misses 104821 102480 -2341
+ Partials 20798 20784 -14
Flags with carried forward coverage won't be shown. Click here to find out more.
|
@mjonss this might be related to (or conflict with) what you are working on. |
@@ -1814,7 +1814,8 @@ func TestParseTimeFromFloat64(t *testing.T) { | |||
{0.0, mysql.TypeDate, 0, 0, 0, 0, 0, 0, 0, nil}, | |||
{20000102030405, mysql.TypeDatetime, 2000, 1, 2, 3, 4, 5, 0, nil}, | |||
{20000102030405.015625, mysql.TypeDatetime, 2000, 1, 2, 3, 4, 5, 15625, nil}, | |||
{20000102030405.0078125, mysql.TypeDatetime, 2000, 1, 2, 3, 4, 5, 7812, nil}, | |||
{20000102030405.0078125, mysql.TypeDatetime, 2000, 1, 2, 3, 4, 5, 7813, nil}, |
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 significant digits of the float fractional part is only '.008' I guess, so does it really matter if it is '.007812' or '.007813' ?
Just try this with your PR:
{20000102030405.0078139, mysql.TypeDatetime, 2000, 1, 2, 3, 4, 5, 7814, nil},
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. The fractional part is only .008
so the fractional part of your case is still 7813
.
As #56339 (comment) said, I just want to make this behavior consistent with TiKV and MySQL.
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.
OK, then I see.
Can you please add tests that will test TiKV/TiFlash/UniStore handling of co-processor calls for this (if exists), so we can show that all four implementations are the same?
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.
I added an integration test to test TiDB(Unistore)/TiKV. TiFlash does not support date_add/date_sub functions with float as the first parameter for now.
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.
@mjonss is this now resolved?
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.
@gengliqi I only see a single integration test. Are you sure it is testing with both TiKV and Unistore?
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, the check_dev
test runs these integration tests with Unistore while the check_dev_2
runs with a real TiKV.
a3f949b
to
5d6be93
Compare
Signed-off-by: gengliqi <gengliqiii@gmail.com>
PR needs rebase. 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. |
@gengliqi could you fix the conflict? |
Signed-off-by: gengliqi <gengliqiii@gmail.com>
Fixed. Thanks for reminding me. |
/ok-to-test |
@gengliqi any idea about why the checks are failing? |
/retest |
1 similar comment
/retest |
It seems it does not relate to this PR. |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: dveeden, mjonss 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 |
What problem does this PR solve?
Issue Number: close #56339
Problem Summary:
See #56339
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.