housepower / ClickHouse-Native-JDBC

ClickHouse Native Protocol JDBC implementation
https://housepower.github.io/ClickHouse-Native-JDBC/
Apache License 2.0
527 stars 145 forks source link

ClickHouseDialect, wrong definition of timestamp type #463

Open EbiousVi opened 3 months ago

EbiousVi commented 3 months ago

Environment

Steps to reproduce

  1. create table with type DateTime('Europe/Moscow') CREATE TABLE IF NOT EXISTS default.foo ( application_id String, event_datetime DateTime('Europe/Moscow'), event_receive_datetime DateTime('Europe/Moscow') ) ENGINE = Log

  2. Try to read table with Spark datasource api v2

When execute this code spark throws TABLE OR VIEW NOT FOUND exception. When I debugging the code, I realized that the case condition is not satisfied. Link to source code where it happens

Although the type matches the regular expression. I'm not an expert in Scala. Help me understand why this happens. Sample code attached.

java code.txt pom.txt