Re: Mapping arithmetic '+' operator with Date and Timestamp operands to target dialect functions

2019-08-27 Thread Julian Hyde
I like the idea of transforming the Rex/Rel tree for the target dialect. Via a RelOptRule or other means. Or perhaps transform the SqlNode tree (which is how we deal with ORDER BY ... NULLS LAST). That’s better, in general, than making the SqlNode-to-string logic more and more complex,

Re: Mapping arithmetic '+' operator with Date and Timestamp operands to target dialect functions

2019-08-26 Thread XING JIN
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