Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix to allow integer division to be cast as double #60

Merged
merged 1 commit into from
Feb 26, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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