calcite-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sachin Rohaj <sachin.29.ro...@gmail.com>
Subject Mapping arithmetic '+' operator with Date and Timestamp operands to target dialect functions
Date Fri, 23 Aug 2019 08:52:45 GMT
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

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message