cast "as.double" and "as.numeric" to DOUBLE PRECISION or FLOAT instead of NUMERIC for Redshift/PostgreSQL #408
Labels
bug
an unexpected problem or unintended behavior
func trans 🌍
Translation of individual functions to SQL
Very similar issue to #379 and (I assume) the associated fix at #388. Casting a string, using
as.numeric()
andas.double()
in Redshift coerces to an integer.Given a column
x
, with the string"0.88"
, the output value is 0. The SQL translation isCAST("x" AS NUMERIC)
in both cases.Using
sql('cast(x AS DOUBLE PRECISION)')
orsql('cast(x AS FLOAT)')
directly outputs the expected0.88
The text was updated successfully, but these errors were encountered: