For oracle you probably want to generate something like
SELECT * FROM "hr"."emp" WHERE "HIRE_DATE" = TRUNC(CURRENT_TIMESTAMP +
INTERVAL '2' HOUR, 'SECOND')

I believe the `+ INTERVAL '2' HOUR` syntax is supported by calcite. So if
you manage to construct it with the builder it should be pushed down.
If you want to construct the query in one way (with timestampadd) and have
it work for both databases then you'll have to change the OracleSqlDialect
to support this.
In that case please log a jira issue as Hongze suggests.

Chris

On Fri, Mar 8, 2019 at 6:01 PM Hongze Zhang <notify...@126.com> wrote:

> If the function TIMESTAMPADD is not supported in Oracle, in general the
> OracleSqlDialect should translate it to some other expressions or calls.
> But it seems that currently the dialect does not provide the
> translation[1].
>
> It would be great if you can log a JIRA case to describe your issue, or
> even contribute a PR to solve the problem.
>
>
> Best,
> Hongze
>
>
> [1]
> https://github.com/apache/calcite/blob/50012d221d6e9a5e42a957ab0723e0f706b25be3/core/src/main/java/org/apache/calcite/sql/dialect/OracleSqlDialect.java#L55
>
> > On Mar 8, 2019, at 7:13 PM, Rakesh Nair <ramkrs...@gmail.com> wrote:
> >
> > TIMESTAMPADD
>
>

-- 

*Christopher Baynes*
Lead Developer

*Contiamo – all your data in one place*

Stresemannstraße 123 (c/o WeWork) | 10963 Berlin | Germany

E-mail:  ch...@contiamo.com

Web: www.contiamo.com
<http://t.sidekickopen65.com/e1t/c/5/f18dQhb0S7lC8dDMPbW2n0x6l2B9nMJW7t5XZs4X9YtjW8q-fZW65jv3RW2zhrDH56dLV8f5DKhvM02?t=http%3A%2F%2Fwww.contiamo.com%2F&si=5165279625740288&pi=bff9f6a3-d8a4-4bf6-87d5-a5464041547d>

Contiamo GmbH, Sitz der Gesellschaft: Berlin
HR Berlin-Charlottenburg, HRB Nr. 156569
Geschäftsführer: Lucia Hegenbartova, Michael Franzkowiak

Reply via email to