Skip to content

clickhouse-jdbc not support localDateTime #583

Description

@gao1399677

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);
    }

Activity

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