You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by GitBox <gi...@apache.org> on 2022/04/15 13:43:25 UTC

[GitHub] [incubator-doris] weilai201 opened a new issue, #9054: [Bug] decimal value is not valid for definition

weilai201 opened a new issue, #9054:
URL: https://github.com/apache/incubator-doris/issues/9054

   ### Search before asking
   
   - [X] I had searched in the [issues](https://github.com/apache/incubator-doris/issues?q=is%3Aissue) and found no similar issues.
   
   
   ### Version
   
   0.15.0-rc4
   
   ### What's Wrong?
   
   I have a column which named `F_B718ADEC73E04CE3EC720DD11A06A308` and  data type is `DECIMAL(20)`. When I insert `1152204005154225920` value ( the length is 19 ) into this column, Occur error '`Reason: decimal value is not valid for definition, column=F_B718ADEC73E04CE3EC720DD11A06A308, value=1152204005154225920, precision=20, scale=0. src line: [];’`. How can i resolve it. Please help me! Thank you!
   
   ### What You Expected?
   
   The value `1152204005154225920` can insert into the column `F_B718ADEC73E04CE3EC720DD11A06A308` ,which data type is `DECIMAL(20)`
   
   ### How to Reproduce?
   
   _No response_
   
   ### Anything Else?
   
   _No response_
   
   ### Are you willing to submit PR?
   
   - [ ] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [incubator-doris] weilai201 commented on issue #9054: [Bug] decimal value is not valid for definition

Posted by GitBox <gi...@apache.org>.
weilai201 commented on issue #9054:
URL: https://github.com/apache/incubator-doris/issues/9054#issuecomment-1100808255

   I look at the source code in` tablet_sink.cpp`, I foud the checker which check maxValue and minValue of decimal `if (dec_val > _max_decimalv2_val[i] || dec_val < _min_decimalv2_val[i])`. 
   
   And I look at the source code in `decimalv2_value.cpp`, I found the max value of integer part is `999999999999999999` and the max value of fractional part is `999999999` . 
   
   But in the document define data type of DECIMAL is `DECIMAL(M[,D])
   高精度定点数,M代表一共有多少个有效数字(precision),D代表小数点后最多有多少数字(scale)
   M的范围是[1,27], D的范围[1, 9], 另外,M必须要大于等于D的取值。默认的D取值为0`


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org