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

Add support for function mod (#2402) #2561

Closed

Conversation

ti-srebot
Copy link
Collaborator

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

cherry-pick #2402 to release-5.0
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/2561

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

git push git@github.com:ti-srebot/tics.git pr/2561:release-5.0-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 added this to the v5.0.4 milestone Aug 4, 2021
@riteme riteme added the type/enhancement Issue or PR for enhancement label Aug 4, 2021
@windtalker
Copy link
Contributor

close as it is not needed in 5.0.x

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 Issue or PR for enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants