bump snowflake (#24480)
* bump snowflake * Handle Types/TIMESTAMP_WITH_TIMEZONE for snowflake Snowflake used to return columns of this type as `Types/TIMESTAMP` = 93. The driver is registered with the legacy stuff ```clojure (driver/register! :snowflake, :parent #{:sql-jdbc ::sql-jdbc.legacy/use-legacy-classes-for-read-and-set}) ``` causing it to hit the following codepath: ```clojure (defmethod sql-jdbc.execute/read-column-thunk [::use-legacy-classes-for-read-and-set Types/TIMESTAMP] [_ ^ResultSet rs _ ^Integer i] (fn [] (when-let [s (.getString rs i)] (let [t (u.date/parse s)] (log/tracef "(.getString rs i) [TIMESTAMP] -> %s -> %s" (pr-str s) (pr-str t)) t)))) ``` But snowflake now reports the column as `Types/TIMESTAMP_WITH_TIMEZONE` = 2014 in https://github.com/snowflakedb/snowflake-jdbc/pull/934/files we no longer hit this string based path for the timestamp with timezone pathway. Instead it hits ```clojure (defn- get-object-of-class-thunk [^ResultSet rs, ^long i, ^Class klass] ^{:name (format "(.getObject rs %d %s)" i (.getCanonicalName klass))} (fn [] (.getObject rs i klass))) ,,, (defmethod read-column-thunk [:sql-jdbc Types/TIMESTAMP_WITH_TIMEZONE] [_ rs _ i] (get-object-of-class-thunk rs i java.time.OffsetDateTime)) ``` And `(.getObject ...)` blows up with an unsupported exception. ```java // @Override public <T> T getObject(int columnIndex, Class<T> type) throws SQLException { logger.debug("public <T> T getObject(int columnIndex,Class<T> type)", false); throw new SnowflakeLoggedFeatureNotSupportedException(session); } ``` There seem to be some `getTimetamp` methods on the `SnowflakeBaseResultSet` that we could call but for now I'm just grabbing the string and we'll parse on our side. One style note, it is not quite clear to me if this should follow the pattern established in `snowflake.clj` driver of setting `defmethod sql-jdbc.execute/read-column-thunk [:snowflake Types/TIMESTAMP_WITH_TIMEZONE]` or if it should follow the legacy pattern of `defmethod sql-jdbc.execute/read-column-thunk [::use-legacy-classes-for-read-and-set Types/TIMESTAMP]`. It seems like almost either would be fine. Just depends on whether other legacy drivers might like this fix which seems possible?
Please register or sign in to comment