Skip to content

Commit

Permalink
Merge pull request #21 from nicolasterral/master
Browse files Browse the repository at this point in the history
Added unix-timestamp->timestamp function.
  • Loading branch information
dacort authored Oct 31, 2019
2 parents 79eac97 + 09fa473 commit 17d4b0d
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 17d4b0d

Please sign in to comment.