odbc icon indicating copy to clipboard operation
odbc copied to clipboard

Updating Snowflake data types

Open jrnold opened this issue 3 years ago • 0 comments

The removes the character constraints on R data types mapped to VARBINARY and VARCHAR columns by the odbcDataType.Snowflake() function.

Character strings in both Snowflake and R are not limited to 255 characters. The documentation for VARCHAR states:

A column consumes storage for only the amount of actual data stored. For example, a 1-character string in a . VARCHAR(16777216) column only consumes a single character.

There is no performance difference between using the full-length VARCHAR declaration VARCHAR(16777216) or a smaller length.

So there shouldn't be any need for specifying a maximum number of characters in R data types that map to VARCHAR and VARBINARY data types.

There is one other purely stylistic change, replacing DOUBLE PRECISION to the synonym FLOAT since the Snowflake docs list DOUBLE PRECISION as one of the synonyms of FLOAT and not vice-versa.

jrnold avatar Feb 23 '22 05:02 jrnold