I think the current implementation is wrong. The validation should check 
against RelDataTypeSystem.getMaxPrecision(SqlTypeName.DECIMAL). And since that 
precision might be larger than allowed by a Java long, it follows that the 
SqlValidatorImpl.validateLiteral should not be converting to long. It should 
keep the value as a BigDecimal.

Now, if you use a RelDataTypeSystem that allows very large-precision DECIMAL 
values, then of course you then need to implement them… but that’s your 
problem, not ours. :)

Can you log a JIRA case please.

Julian


> On May 8, 2017, at 5:25 AM, Hezhiqiang (Ransom) 
> <[email protected]> wrote:
> 
> Hi all.
>          What’s the range of decimal data type in calcite?
>          In SqlValidatorImpl. validateLiteral method , decimal range 
> validate. It used a long value to validate it .
>          Is it means decimal type max value in calcite is 922337203685477580.7
>          And the min value in calcite is -922337203685477580.8
>          And the scale value is 0.9223372036854775807
> How to create a decimal literal like 99999999999999999999999999.999999999999 ?
>  
>  
> Regards
> Ransom

Reply via email to