You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Redshift's numeric (== decimal) type has a default scale (number of decimal places) of 0, so naively casting values to numeric can lead to surprising results.
The Redshift backend already guards against this, by instead casting to float:
However the Postgres backend, which the Redshift backend inherits from, uses a custom function for its translation of round(), which contains an explicit cast to numeric:
Redshift's
numeric
(==decimal
) type has a default scale (number of decimal places) of 0, so naively casting values tonumeric
can lead to surprising results.The Redshift backend already guards against this, by instead casting to
float
:dbplyr/R/backend-redshift.R
Line 40 in f4cef23
However the Postgres backend, which the Redshift backend inherits from, uses a custom function for its translation of
round()
, which contains an explicit cast tonumeric
:This means we end up with the following SQL translation:
This always:
numeric
Hopefully an easy fix by overriding
round
in the Redshift translator with a smallround_redshift()
function - I'll add a pull request shortly!The text was updated successfully, but these errors were encountered: