Skip to content

Date literal issue in the JDBC driver #457

Closed

Description

@bas-ter

Hi, I'm using clickhouse-jdbc driver in the Oracle Bi server environment and it works perfectly except the one thing. The JDBC driver doesn't support date literals in SQL statements written in the format:
{d 'yyyy-mm-dd'} where yyyy-mm-dd represents the year, month, and day; for example, {d '1998-10-22'}.
Is there any way to add this functionality to the clickhouse-jdbc driver?
Or as a workaround is it possible to duplicate an existing function "todate" with the same name as it is in Oracle "to_date"?

Thank you in advance.

Activity

  1. added this to the 0.3.0 release milestone on Jan 11, 2021
  2. self-assigned this
    on Nov 28, 2021
  3. linked a pull request that will close this issueEnhance new JDBC driver #765on Nov 29, 2021
  4. zhicwu commented on Dec 10, 2021

    @zhicwu
    Contributor

    This was supported since 0.3.2-test2, but just some very basic ones:

    • {d '2021-11-01'} -> date'2021-11-01'
    • {t '12:34:56'} -> timestamp'1970-01-01 12:34:56'
    • {ts '2021-11-01 12:34:56'} -> timestamp'2021-11-01 12:34:56'
    • {ts '2021-11-01 12:34:56.78'} -> toDateTime64('2021-11-01 12:34:56.78', 2)
    • {tt 'my_temp\'_''table'} -> `my_temp'_'table`
      Note: tt is short for temporary table. It's a hint for using external table or creating a session-level temporary table.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions