-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
[Enhancement] Support overflow mode for decimal type #30419
Conversation
de6045b
to
031650c
Compare
Signed-off-by: liuyehcf <[email protected]>
031650c
to
cfd787f
Compare
Signed-off-by: liuyehcf <[email protected]>
ecdea0f
to
014f9e5
Compare
-- !result | ||
select /*+ SET_VAR(sql_mode='ERROR_IF_OVERFLOW')*/ cast(c_d32 * c_d32 as decimal32) from t_decimal_overflow where c_id = 1; | ||
-- result: | ||
E: (1064, 'Expr evaluate meet error: Decimal overflow') |
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.
from the error msg, we can't know which expr report this error, can the error specify the operator?
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.
Add more precise information.
Signed-off-by: liuyehcf <[email protected]>
SonarCloud Quality Gate failed. 6 Bugs 0.0% Coverage Catch issues before they fail your Quality Gate with our IDE extension SonarLint |
[FE Incremental Coverage Report]😍 pass : 3 / 3 (100.00%) file detail
|
[BE Incremental Coverage Report]😞 fail : 54 / 112 (48.21%) file detail
|
@Mergifyio backport branch-3.1 |
@Mergifyio backport branch-3.0 |
@Mergifyio backport branch-2.5 |
✅ Backports have been created
|
✅ Backports have been created
|
✅ Backports have been created
|
Signed-off-by: liuyehcf <[email protected]> (cherry picked from commit 228c120) # Conflicts: # gensrc/thrift/InternalService.thrift
Signed-off-by: liuyehcf <[email protected]> (cherry picked from commit 228c120) # Conflicts: # be/src/exprs/function_context.cpp # be/src/exprs/function_context.h # be/src/exprs/vectorized/arithmetic_expr.cpp # be/src/exprs/vectorized/arithmetic_operation.h # be/src/exprs/vectorized/cast_expr.cpp # be/src/exprs/vectorized/decimal_binary_function.h # be/src/exprs/vectorized/decimal_cast_expr.h # be/test/exprs/vectorized/decimal_binary_function_test.cpp # fe/fe-core/src/main/java/com/starrocks/qe/SessionVariable.java # gensrc/thrift/InternalService.thrift
Signed-off-by: liuyehcf <[email protected]> (cherry picked from commit 228c120) # Conflicts: # be/test/exprs/decimal_binary_function_test.cpp # gensrc/thrift/InternalService.thrift
#30710) Signed-off-by: liuyehcf <[email protected]> Co-authored-by: liuyehcf <[email protected]>
#30709) Signed-off-by: liuyehcf <[email protected]> Co-authored-by: liuyehcf <[email protected]>
#30708) Signed-off-by: liuyehcf <[email protected]> Co-authored-by: liuyehcf <[email protected]>
Main work
Support error reporting when decimal overflow by introducing a OverflowMode, which has three different modes:
This behavior can be enabled by setting session varaible
set sql_mode='ERROR_IF_OVERFLOW'
What type of PR is this:
Does this PR entail a change in behavior?
If yes, please specify the type of change:
Checklist:
Bugfix cherry-pick branch check: