You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@calcite.apache.org by Mihai Budiu <mb...@gmail.com> on 2026/03/24 04:33:00 UTC
Lenient coercion table
Calcite has a SqlTypeCoercionRule class, which has two instances: LENIENT and INSTANCE. You would expect the LENIENT version to allow MORE type conversions, but it's actually the opposite.
For example, there are 18 casts allowed to TINYINT in the LENIENT version, but 30 in the other version.
Is this a bug, or is this intentional?
Mihai
Re: Lenient coercion table
Posted by Mihai Budiu <mb...@gmail.com>.
The problem is that it may not be easy to fix.
Swapping this may break some tests.
Mihai
________________________________
From: Stamatis Zampetakis <za...@gmail.com>
Sent: Tuesday, March 24, 2026 11:41 AM
To: dev@calcite.apache.org <de...@calcite.apache.org>
Subject: Re: Lenient coercion table
I took a quick look at the code and to me it seems like a copy-paste
bug rather than intentional.
Best,
Stamatis
On Tue, Mar 24, 2026 at 5:33 AM Mihai Budiu <mb...@gmail.com> wrote:
>
> Calcite has a SqlTypeCoercionRule class, which has two instances: LENIENT and INSTANCE. You would expect the LENIENT version to allow MORE type conversions, but it's actually the opposite.
>
> For example, there are 18 casts allowed to TINYINT in the LENIENT version, but 30 in the other version.
>
> Is this a bug, or is this intentional?
>
> Mihai
Re: Lenient coercion table
Posted by Stamatis Zampetakis <za...@gmail.com>.
I took a quick look at the code and to me it seems like a copy-paste
bug rather than intentional.
Best,
Stamatis
On Tue, Mar 24, 2026 at 5:33 AM Mihai Budiu <mb...@gmail.com> wrote:
>
> Calcite has a SqlTypeCoercionRule class, which has two instances: LENIENT and INSTANCE. You would expect the LENIENT version to allow MORE type conversions, but it's actually the opposite.
>
> For example, there are 18 casts allowed to TINYINT in the LENIENT version, but 30 in the other version.
>
> Is this a bug, or is this intentional?
>
> Mihai