question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

clickhouse-jdbc not support localDateTime

See original GitHub issue

versions: clickhouse-jdbc 0.2.6 with mybatis3.4.5

reappear: set sql param type localDateTime with value(“2021-02-24 00:00:00”)

exception:
Error querying database. Cause: ru.yandex.clickhouse.except.ClickHouseException: ClickHouse exception, code: 41, host: ******, port: **; Code: 41, e.displayText() = DB::Exception: Cannot parse datetime 2021-02-23T00:00: while converting ‘2021-02-23T00:00’ to DateTime (version 20.8.2.3 (official build))

issues clickhouse-jdbc convert LocalDateTime and LocalDate to string in related code missing formatLocalDate() and formatLocalDateTime() method

public static String formatDate(Date date, TimeZone timeZone) {
        getDateFormat().setTimeZone(timeZone);
        return getDateFormat().format(date);
    }

    public static String formatTime(Time time, TimeZone timeZone) {
        getDateTimeFormat().setTimeZone(timeZone);
        return getDateTimeFormat().format(time);
    }

    public static String formatTimestamp(Timestamp time, TimeZone timeZone) {
        getDateTimeFormat().setTimeZone(timeZone);
        return getDateTimeFormat().format(time);
    }

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:12 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
zhicwucommented, Mar 5, 2021

I think we need to implement a mechanism for type conversion. For now, I’m good to merge the workaround into ResultSet.getObject method. I’ll include this in the pull request for more data types.

1reaction
zhicwucommented, Mar 2, 2021

It’s available in develop branch and it will be released in v0.3.0. I think I still need a week or two to add more test cases to ensure the driver works well.

Read more comments on GitHub >

github_iconTop Results From Across the Web

v2.5.4 (2021年3月1日) - ClickHouse Native JDBC
变更日志. Implement clickhouse-integration-spark base on Spark Jdbc DataSource API (#170 #184); Batch insert support nullable types in arrays ...
Read more >
DateTime | ClickHouse Docs
DateTime. Allows to store an instant in time, that can be expressed as a calendar date and a time of a day. Syntax:...
Read more >
ClickHouse / clickhouse-jdbc Download - JitPack
ClickHouseDriver have been deprecated and no longer receive updates. Please use new groupId com.clickhouse and driver com.clickhouse.jdbc.
Read more >
jdbc driver - Google Groups
to ClickHouse. +1. It would be great the JDBC driver supports the real-time stats for the queries that are executed. The HTTP API...
Read more >
ClickHouse connector — Starburst Enterprise
The supported parameters for the URL are available in the ClickHouse JDBC driver configuration. ... Do not change this setting from the default....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found