Skip to content

Commit 762dad2

Browse files
authored
Merge pull request #60 from yyie/master
Fix to allow integer division to be cast as double
2 parents 274fdf3 + f3db8a5 commit 762dad2

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

src/metabase/driver/athena.clj

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,11 @@
152152
(hsql/raw (int amount))
153153
(hx/->timestamp hsql-form)))
154154

155+
;; fix to allow integer division to be cast as double (float is not suported by athena)
156+
(defmethod sql.qp/->float :athena
157+
[_ value]
158+
(hx/cast :double value))
159+
155160
;; keyword function converts database-type variable to a symbol, so we use symbols above to map the types
156161
(defn- database-type->base-type-or-warn
157162
"Given a `database-type` (e.g. `VARCHAR`) return the mapped Metabase type (e.g. `:type/Text`)."

0 commit comments

Comments
 (0)