-
Notifications
You must be signed in to change notification settings - Fork 1.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
Refactor decimal multiplication #4211
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
satanson
force-pushed
the
refactor_decimal_multiply
branch
4 times, most recently
from
March 18, 2022 04:32
feead53
to
902203b
Compare
run starrocks_fe_unittest |
kangkaisen
reviewed
Mar 18, 2022
run starrocks_fe_unittest |
murphyatwork
previously approved these changes
Mar 18, 2022
Can't set status; build failed. |
run starrocks_fe_unittest |
1 similar comment
run starrocks_fe_unittest |
satanson
force-pushed
the
refactor_decimal_multiply
branch
from
March 21, 2022 02:49
902203b
to
452388d
Compare
kangkaisen
previously approved these changes
Mar 21, 2022
run starrocks_be_unittest |
satanson
force-pushed
the
refactor_decimal_multiply
branch
from
March 21, 2022 06:39
452388d
to
0c397e2
Compare
@Mergifyio rebase |
✅ Branch has been successfully rebased |
wanpengfei-git
force-pushed
the
refactor_decimal_multiply
branch
from
March 21, 2022 12:47
0c397e2
to
2c380c2
Compare
run starrocks_fe_unittest |
@Mergifyio rebase |
✅ Branch has been successfully rebased |
wanpengfei-git
force-pushed
the
refactor_decimal_multiply
branch
from
March 22, 2022 03:03
2c380c2
to
2db3785
Compare
run starrocks_fe_unittest |
[FE PR Coverage check]😍 pass : 21 / 21 (100.00%) file detail
|
murphyatwork
approved these changes
Mar 22, 2022
kangkaisen
approved these changes
Mar 22, 2022
ZiheLiu
approved these changes
Mar 22, 2022
stdpain
approved these changes
Mar 22, 2022
@mergify backport branch-2.2 |
mergify bot
pushed a commit
that referenced
this pull request
Mar 22, 2022
(cherry picked from commit 31d53c2) # Conflicts: # fe/fe-core/src/test/java/com/starrocks/sql/plan/AggregateTest.java # fe/fe-core/src/test/java/com/starrocks/sql/plan/ExpressionTest.java
✅ Backports have been created
Hey, I reacted but my real name is @Mergifyio |
satanson
added a commit
to satanson/starrocks
that referenced
this pull request
Mar 22, 2022
kangkaisen
pushed a commit
that referenced
this pull request
Mar 22, 2022
liuyehcf
pushed a commit
to liuyehcf/starrocks
that referenced
this pull request
Apr 18, 2022
kangkaisen
pushed a commit
that referenced
this pull request
Apr 18, 2022
liuyehcf
pushed a commit
to liuyehcf/starrocks
that referenced
this pull request
Apr 18, 2022
satanson
added a commit
to satanson/starrocks
that referenced
this pull request
Apr 18, 2022
* Refactor decimal multiplication (StarRocks#4211) * Fixup: decimal * decimal(0,0) report error (StarRocks#4359) Co-authored-by: satanson <ranpanf@gmail.com>
jaogoy
pushed a commit
to jaogoy/starrocks
that referenced
this pull request
Nov 15, 2023
* update unload by flink connector doc * Update Flink_connector.md (cherry picked from commit 522585b) # Conflicts: # unloading/Flink_connector.md Co-authored-by: amber-create <57167462+amber-create@users.noreply.github.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What type of PR is this:
Which issues of this PR fixes :
Problem Summary(Required) :
Old decimal multiplication scale adjust rules is not robust, becase of a narrow decimal multiplied by another narrow decimal yields a narrow decimal, too. for example decimal64(10,2) * decimal64(10,2) yields decimal32(18,4), the result maybe overflow. so we must cast the narrow decimal to wide decimal if necessary to void overflow.
New decimal multiplication scale adjust rules as follows:
decimal(p1,s1) * decimal(p2, s2) => decimal(p, s)
At first, denote p' = p1 + p2, s' = s1+s2;
p = p1+ p2, s = s1+s2;
for examples:
decimal32(4,3) * decimal32(4,3) => decimal32(8,6);
decimal64(15,3) * decimal32(9,4) => decimal128(24,7).
p = 38, s = s1 + s2
for examples:
decimal128(23,5) * decimal64(18,4) => decimal128(38, 9).
decimal arithmetic are testified both in disable/enable overflow check in BE, so now we turn on overflow check on BE for decimal arithmetic operations.