Skip to content

Add support for function mod (#2402)#2560

Closed
ti-srebot wants to merge 1 commit intopingcap:release-5.1from
ti-srebot:release-5.1-685880a29558
Closed

Add support for function mod (#2402)#2560
ti-srebot wants to merge 1 commit intopingcap:release-5.1from
ti-srebot:release-5.1-685880a29558

Conversation

@ti-srebot
Copy link
Collaborator

@ti-srebot ti-srebot commented Aug 4, 2021

cherry-pick #2402 to release-5.1
You can switch your code base to this Pull Request by using git-extras:

# In tics repo:
git pr https://github.com/pingcap/tics/pull/2560

After apply modifications, you can push your change to this PR via:

git push git@github.com:ti-srebot/tics.git pr/2560:release-5.1-685880a29558

What problem does this PR solve?

Issue Number: close #2318

Problem Summary: enable pushing function mod down to TiFlash.

What is changed and how it works?

Proposal:

What's Changed:

  • Decimal.h: compatible with TiDB.
  • DataTypeDecimal.h: add a helper function to get decimal precision in unit test.
  • DAGUtils.cpp: add mappings from TiPB codes to scalar function name.
  • FunctionArithmetic.h: update implementation of FunctionModulo.
  • NumberTraits.h: fix modulo result type deduction.
  • types.h: add actual_type, which returns correct size of boost multiprecision integer.
  • mod.test, mod_extra.test: the integration test.
  • gtest_arithmetic_functions.cpp: the unit test.

Related changes

  • PR to update pingcap/docs/pingcap/docs-cn:
  • Need to cherry-pick to the release branch:

Check List

  • Examine current implementation
    • Return type detection
    • Decimal precision and scale
    • Floating point: INF, NaN
  • Fix compiler warnings

Tests

  • Unit test
  • Integration test

Release note

  • Support pushing down MOD(N, M) to TiFlash.

Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
@ti-srebot ti-srebot mentioned this pull request Aug 4, 2021
7 tasks
@ti-srebot ti-srebot added the CHERRY-PICK cherry pick label Aug 4, 2021
@ti-srebot ti-srebot requested a review from fuzhe1989 August 4, 2021 05:43
@ti-srebot ti-srebot added this to the v5.1.2 milestone Aug 4, 2021
@riteme riteme added the type/enhancement The issue or PR belongs to an enhancement. label Aug 4, 2021
@riteme riteme force-pushed the release-5.1-685880a29558 branch from ee8156a to 66c72ac Compare August 5, 2021 05:52
@JaySon-Huang JaySon-Huang modified the milestones: v5.1.2, v5.1.3 Oct 11, 2021
@fuzhe1989 fuzhe1989 closed this Oct 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CHERRY-PICK cherry pick type/enhancement The issue or PR belongs to an enhancement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants