Skip to content

Commit

Permalink
Added unix-timestamp->timestamp function.
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicolas Terral committed Oct 29, 2019
1 parent 79eac97 commit 09fa473
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/metabase/driver/athena.clj
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,8 @@

(defmethod sql.qp/current-datetime-fn :athena [_] (du/->Timestamp (System/currentTimeMillis)))

(defmethod sql.qp/unix-timestamp->timestamp [:athena :seconds] [_ _ expr] (hsql/call :from_unixtime expr))

(defmethod driver/date-add :athena [driver dt amount unit] (du/relative-date unit amount dt))

;; keyword function converts database-type variable to a symbol, so we use symbols above to map the types
Expand Down Expand Up @@ -262,4 +264,4 @@
:query (unprepare/unprepare driver (cons (:query query) (:params query)))}})))

(defmethod driver/execute-query :athena [driver query]
(sql-jdbc.execute/execute-query driver (prepare-query driver, query)))
(sql-jdbc.execute/execute-query driver (prepare-query driver, query)))

0 comments on commit 09fa473

Please sign in to comment.