Thanks!
But I think I shouldn't create my own implementation of TypeCoercion. I can
just extend the existing TypeCoercionImpl if I will add
isStringToArrayCastEnabled() (by analogy with isTypeCoercionEnabled) to
SqlCallBinding in order to only postgres dialect has this feature.

On Mon, May 16, 2022 at 12:35 PM Stamatis Zampetakis <[email protected]>
wrote:

> Hi Dmitry,
>
> There is the TypeCoercion [1] interface that allows you to customize how
> implicit casts work.
> I guess you need to create your own implementation, customize the behavior
> of the binaryComparisonCoercion method (possibly others as well), and pass
> it to the validator.
>
> Best,
> Stamatis
>
> [1]
>
> https://github.com/apache/calcite/blob/1bce280a2957326dc5c249cfd079edfd2c54adf4/core/src/main/java/org/apache/calcite/sql/validate/implicit/TypeCoercion.java
>
> On Thu, May 12, 2022 at 4:42 PM Dmitry Sysolyatin <[email protected]
> >
> wrote:
>
> > Hi!
> >
> > I would like to implement implicit cast from string to array as PG does.
> > For example: "SELECT ARRAY[1,2,3] = '{1,2,3};'" should return true
> instead
> > of exception for Postgres dialect
> >
> > Is there an easy way to implement implicit cast?
> >
>

Reply via email to