Skip to content

Commit

Permalink
Merge pull request #60 from yyie/master
Browse files Browse the repository at this point in the history
Fix to allow integer division to be cast as double
  • Loading branch information
dacort authored Feb 26, 2021
2 parents 274fdf3 + f3db8a5 commit 762dad2
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/metabase/driver/athena.clj
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,11 @@
(hsql/raw (int amount))
(hx/->timestamp hsql-form)))

;; fix to allow integer division to be cast as double (float is not suported by athena)
(defmethod sql.qp/->float :athena
[_ value]
(hx/cast :double value))

;; keyword function converts database-type variable to a symbol, so we use symbols above to map the types
(defn- database-type->base-type-or-warn
"Given a `database-type` (e.g. `VARCHAR`) return the mapped Metabase type (e.g. `:type/Text`)."
Expand Down

0 comments on commit 762dad2

Please sign in to comment.