refine get type from decimal literal#5014
Conversation
|
[REVIEW NOTIFICATION] This pull request has been approved by:
To complete the pull request process, please ask the reviewers in the list to review by filling The full list of commands accepted by this bot can be found here. DetailsReviewer can indicate their review by submitting an approval review. |
2019915 to
4388a05
Compare
|
/run-all-tests |
| /// inserted into a decimal column with type `Decimal(getPrecWithCurrentDecimalType, getScale)` | ||
| UInt32 getPrecWithCurrentDecimalType() const | ||
| { | ||
| auto raw_prec = getPrec(); |
There was a problem hiding this comment.
Will getPrec() > maxDecimalPrecision<T>?
There was a problem hiding this comment.
No, basically, getPrec() is getting the precision of a literal of type T, so getPrec() > maxDecimalPrecision<T> should not happen.
There was a problem hiding this comment.
add assert(getPrec() <= maxDecimalPrecision<T>)?
| TEST(DecimalLiteralDataTypeTest, fieldToDataType) | ||
| try | ||
| { | ||
| ASSERT_TRUE(DataTypeFactory::instance().get("Decimal(1,0)")->equals(*applyVisitor(FieldToDataType(), Field(DecimalField<Decimal32>(0, 0))))); |
There was a problem hiding this comment.
| ASSERT_TRUE(DataTypeFactory::instance().get("Decimal(1,0)")->equals(*applyVisitor(FieldToDataType(), Field(DecimalField<Decimal32>(0, 0))))); | |
| /// decimal32 | |
| ASSERT_TRUE(DataTypeFactory::instance().get("Decimal(1,0)")->equals(*applyVisitor(FieldToDataType(), Field(DecimalField<Decimal32>(0, 0))))); |
There was a problem hiding this comment.
nit: Add annotation to make it clear to read the test.
Signed-off-by: xufei <xufeixw@mail.ustc.edu.cn>
Signed-off-by: xufei <xufeixw@mail.ustc.edu.cn>
Signed-off-by: xufei <xufeixw@mail.ustc.edu.cn>
8c70b2e to
565161b
Compare
|
/merge |
|
@windtalker: It seems you want to merge this PR, I will help you trigger all the tests: /run-all-tests You only need to trigger If you have any questions about the PR merge process, please refer to pr process. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository. |
|
This pull request has been accepted and is ready to merge. DetailsCommit hash: 565161b |
Coverage for changed filesCoverage summaryfull coverage report (for internal network access only) |
Signed-off-by: xufei xufeixw@mail.ustc.edu.cn
What problem does this PR solve?
Issue Number: close #5007
Problem Summary:
As the issue described.
What is changed and how it works?
FieldToDataTypewill return a more precise type for DecimalFieldCheck List
Tests
Side effects
Documentation
Release note