According to the SQL standard (SQL 2011: 4.6.3 section):

Within a value of type interval, the first field is constrained only by the
> <interval leading field precision> of the associated <interval qualifier>.
> Table 6, “Valid values for fields in INTERVAL values”, specifies the con-
> straints on subsequent field values.
> <interval leading field precision> ::=
>   <unsigned integer>


For the first field, the values could be any unsigned integer.
I think we can add this support.


Viliam Durina <[email protected]> 于2022年10月25日周二 20:01写道:

> Hi all,
>
> In Calcite the precision of SECOND interval is 2 by default. That is, if
> one specifies `INTERVAL `100` SECONDS`, the validation currently fails with
> `Interval field value 100 exceeds precision of SECOND(2) field`. One has to
> specify either `INTERVAL '1:40' MINUTE TO SECOND` or `INTERVAL '100'
> SECOND(3)`.
>
> I checked the behavior in other products, all major databases allow larger
> numbers. For example, MySQL, such values are allowed, but MySQL dialect in
> calcite doesn't allow it. Wdyt about adding such support?
>
> With kind regards,
> Viliam
>
> --
> This message contains confidential information and is intended only for
> the
> individuals named. If you are not the named addressee you should not
> disseminate, distribute or copy this e-mail. Please notify the sender
> immediately by e-mail if you have received this e-mail by mistake and
> delete this e-mail from your system. E-mail transmission cannot be
> guaranteed to be secure or error-free as information could be intercepted,
> corrupted, lost, destroyed, arrive late or incomplete, or contain viruses.
> The sender therefore does not accept liability for any errors or omissions
> in the contents of this message, which arise as a result of e-mail
> transmission. If verification is required, please request a hard-copy
> version. -Hazelcast
>


-- 

Best,
Benchao Li

Reply via email to