I guess in your approach, you need to maintain a customized
`SqlImplementor` ?
How about add a RelOptRule and detect pattern of "date + interval '1' DAY"
and use a RexShuttle to convert to "target_func(date, interval '1' DAY)"
Thus only a RelOptRule needs to be maintained.

Sachin Rohaj <sachin.29.ro...@gmail.com> 于2019年8月23日周五 下午11:32写道:

> Hello,
>
> In one of my use case i am working on DATE and TIMESTAMP based operands. We
> have
> select date + interval '1' DAY from table;
>
> I need to map this to target dialect.
> select target_func(date, interval '1' DAY) from table;
>
> *Approach*: I am planning to intercept the '+' operator in the
> 'SqlImplementor' class using 'call.type.getSqlTypeName()' and delegate that
> responsibility to get the 'target_func' from the specific dialect.
> For exampe: 'dialect.getTargetFunction(SqlTypeName)'.
>
> Thanks,
> Sachin
>

Reply via email to