snowflakedb/snowflake-jdbc

SNOW-982484: Data type not supported for binding: 2014

Closed this issue · 1 comments

aveu commented
  1. What version of JDBC driver are you using?
    3.14.3

  2. What operating system and processor architecture are you using?
    MacOS

  3. What version of Java are you using?
    17 + springboot 3.1.6

  4. What did you do?

    Trying to get data with where condition with timestamp with timezone parameter:

    @Query("""
            select x from X x
            where x.lastModifiedDate >= :lastModifiedDate
            """)
    Slice<X> findBy(
            @Param("lastModifiedDate") ZonedDateTime lastModifiedDate,
            Pageable pageable);
  1. What did you expect to see?

    Query should be executed, exception is thrown instead.

  2. Can you set logging to DEBUG and collect the logs?

    In debugger in org.hibernate.sql.exec.internal.AbstractJdbcParameter#bindParameterValue(java.sql.PreparedStatement, int, org.hibernate.sql.exec.spi.JdbcParameterBindings, org.hibernate.sql.exec.spi.ExecutionContext) parameters are:

  • bindValue: 2023-11-01T11:26:13.451259+01:00[Europe/Warsaw]
  • jdbcMapping: basicType@22(java.time.ZonedDateTime,2014)

Then there is no condition for code 2014 in method: net.snowflake.client.jdbc.SnowflakeType#javaTypeToSFType and exception is thrown:

2023-12-01 11:43:04,041  WARN [com.zaxxer.hikari.pool.ProxyConnection] [quartzScheduler_Worker-1] HikariPool-2 - Connection net.snowflake.client.jdbc.SnowflakeConnectionV1@26a202ae marked as broken because of SQLSTATE(0A000), ErrorCode(200018)

net.snowflake.client.jdbc.SnowflakeSQLLoggedException: Data type not supported for binding: 2,014.

thank you for raising this - we'll track the effort of supporting the missing date/time types on #1494