You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@doris.apache.org by ziji <zh...@163.com> on 2022/04/15 13:07:33 UTC

decimal value is not valid for definition

Hi, I have a column named F_B718ADEC73E04CE3EC720DD11A06A308. The data type is DECIMAL(20). But when I insert ‘1152204005154225920’ value( the length is 19) into the column, occur error 'Reason: decimal value is not valid for definition, column=F_B718ADEC73E04CE3EC720DD11A06A308, value=1152204005154225920, precision=20, scale=0. src line: [];’. Please help me! Thank you!


The doris version is 0.15.0-rc4.




Re:decimal value is not valid for definition

Posted by 陈明雨 <mo...@163.com>.
This is indeed a problem. Acutally, Doris currently not support decimal(20, 0).
The rule is:
(precision - scale) should >= (27 - 9). That is, the max length of integer part is 18.
So the following decimal is acceptable:
decimal(18, 0)
decimal(20, 2)
decimal(27, 9)


This is not a good design, we are working on refactoring decimal type. But if you still need to use decimal, you have
to follow to rule above.




--

此致!Best Regards
陈明雨 Mingyu Chen

Email:
chenmingyu@apache.org





At 2022-04-15 21:07:33, "ziji" <zh...@163.com> wrote:
>Hi, I have a column named F_B718ADEC73E04CE3EC720DD11A06A308. The data type is DECIMAL(20). But when I insert ‘1152204005154225920’ value( the length is 19) into the column, occur error 'Reason: decimal value is not valid for definition, column=F_B718ADEC73E04CE3EC720DD11A06A308, value=1152204005154225920, precision=20, scale=0. src line: [];’. Please help me! Thank you!
>
>
>The doris version is 0.15.0-rc4.
>
>
>