Skip to content
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

support tidb truncate function #9842

Merged
merged 10 commits into from
Feb 11, 2025
Merged

Conversation

guo-shaoge
Copy link
Contributor

@guo-shaoge guo-shaoge commented Feb 6, 2025

What problem does this PR solve?

Issue Number: close #9846

Problem Summary:

What is changed and how it works?


Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No code

Side effects

  • Performance regression: Consumes more CPU
  • Performance regression: Consumes more Memory
  • Breaking backward compatibility

Documentation

  • Affects user behaviors
  • Contains syntax changes
  • Contains variable changes
  • Contains experimental features
  • Changes MySQL compatibility

Release note

None

@ti-chi-bot ti-chi-bot bot added do-not-merge/needs-linked-issue release-note-none Denotes a PR that doesn't merit a release note. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Feb 6, 2025
@ti-chi-bot ti-chi-bot bot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Feb 6, 2025
@guo-shaoge guo-shaoge requested a review from yibin87 February 6, 2025 09:00
Signed-off-by: guo-shaoge <shaoge1994@163.com>
Signed-off-by: guo-shaoge <shaoge1994@163.com>
@guo-shaoge guo-shaoge requested a review from windtalker February 7, 2025 06:10
Signed-off-by: guo-shaoge <shaoge1994@163.com>
Signed-off-by: guo-shaoge <shaoge1994@163.com>
dbms/src/Functions/FunctionsRound.h Outdated Show resolved Hide resolved
dbms/src/Functions/FunctionsRound.h Outdated Show resolved Hide resolved
Signed-off-by: guo-shaoge <shaoge1994@163.com>
Signed-off-by: guo-shaoge <shaoge1994@163.com>
Signed-off-by: guo-shaoge <shaoge1994@163.com>
Copy link
Contributor

@yibin87 yibin87 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ti-chi-bot ti-chi-bot bot added needs-1-more-lgtm Indicates a PR needs 1 more LGTM. approved labels Feb 10, 2025
dbms/src/Functions/FunctionsRound.h Outdated Show resolved Hide resolved
// modified from <https://github.com/pingcap/tidb/blob/26237b35f857c2388eab46f9ee3b351687143681/types/helper.go#L33-L48>.

// modified from https://github.com/pingcap/tidb/blob/26237b35f857c2388eab46f9ee3b351687143681/types/helper.go#L33-L48 and
// https://github.com/pingcap/tidb/blob/26237b35f857c2388eab46f9ee3b351687143681/types/helper.go#L50-L61.
Copy link
Contributor

@gengliqi gengliqi Feb 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems that ConstPowOf10 can be used to optimize the code in Line 986 base = std::pow(10.0, frac)

Copy link
Contributor Author

@guo-shaoge guo-shaoge Feb 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It needs more efforts to make sure correctness and performance improvement. Maybe we should to it in another pr

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

create a new issue to record: #9860

Signed-off-by: guo-shaoge <shaoge1994@163.com>
@guo-shaoge guo-shaoge requested a review from gengliqi February 11, 2025 02:35
Copy link
Contributor

ti-chi-bot bot commented Feb 11, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: gengliqi, yibin87

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ti-chi-bot ti-chi-bot bot added lgtm and removed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Feb 11, 2025
Copy link
Contributor

ti-chi-bot bot commented Feb 11, 2025

[LGTM Timeline notifier]

Timeline:

  • 2025-02-10 09:02:42.710395589 +0000 UTC m=+260805.106617650: ☑️ agreed by yibin87.
  • 2025-02-11 06:37:17.327355057 +0000 UTC m=+338479.723577120: ☑️ agreed by gengliqi.

@guo-shaoge
Copy link
Contributor Author

/retest

@guo-shaoge
Copy link
Contributor Author

/retest

@ti-chi-bot ti-chi-bot bot merged commit 4ffbd35 into pingcap:master Feb 11, 2025
5 checks passed
@guo-shaoge guo-shaoge deleted the tidb_truncate branch February 11, 2025 10:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved lgtm release-note-none Denotes a PR that doesn't merit a release note. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

pushdown tidb truncate to tiflash
3 participants