{"action":"created","issue":{"url":"https://api.github.com/repos/tidyverse/dplyr/issues/3236","repository_url":"https://api.github.com/repos/tidyverse/dplyr","labels_url":"https://api.github.com/repos/tidyverse/dplyr/issues/3236/labels{/name}","comments_url":"https://api.github.com/repos/tidyverse/dplyr/issues/3236/comments","events_url":"https://api.github.com/repos/tidyverse/dplyr/issues/3236/events","html_url":"https://github.com/tidyverse/dplyr/issues/3236","id":278527316,"number":3236,"title":"\"Type DOUBLE does not exist\" in Vertica database","user":{"login":"ablack3","id":10227522,"avatar_url":"https://avatars1.githubusercontent.com/u/10227522?v=4","gravatar_id":"","url":"https://api.github.com/users/ablack3","html_url":"https://github.com/ablack3","followers_url":"https://api.github.com/users/ablack3/followers","following_url":"https://api.github.com/users/ablack3/following{/other_user}","gists_url":"https://api.github.com/users/ablack3/gists{/gist_id}","starred_url":"https://api.github.com/users/ablack3/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ablack3/subscriptions","organizations_url":"https://api.github.com/users/ablack3/orgs","repos_url":"https://api.github.com/users/ablack3/repos","events_url":"https://api.github.com/users/ablack3/events{/privacy}","received_events_url":"https://api.github.com/users/ablack3/received_events","type":"User","site_admin":false},"labels":[{"id":213548409,"url":"https://api.github.com/repos/tidyverse/dplyr/labels/database","name":"database","color":"eeeeee","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":14,"created_at":"2017-12-01T16:48:16Z","updated_at":"2018-03-06T22:47:35Z","closed_at":null,"author_association":"NONE","body":"I have an ODBC connection to a Vertica database and am using dplyr to query it. \r\n\r\nVertica has types DOUBLE PRECISION and NUMERIC but does not have type DOUBLE.\r\n\r\nWhen I try to convert a variable of type CHARACTER to NUMERIC dplyr generates incorrect SQL code. \r\n\r\nUnfortunately I cannot create a fully reproducible example because the issue involves a Vertica database connection.\r\n\r\n```r\r\ncon <- DBI:: dbConnect(odbc::odbc(), dsn = \"Vertica\")\r\ndbplyr::translate_sql(as.numeric(myVar), con = con)\r\n```\r\n<SQL> CAST(\"myVar\" AS DOUBLE)\r\nThis will not work since DOUBLE is not a valid type in Vertica.\r\nDOUBLE PRECISION or NUMERIC should work.\r\n\r\nI get the same issue when I use as.double()\r\n```r\r\ndbplyr::translate_sql(as.double(myVar), con = con)\r\n```\r\n<SQL> CAST(\"myVar\" AS DOUBLE)\r\n\r\n\r\nHowever if I leave off the connection argument the correct SQL is generated\r\n```r\r\ndbplyr::translate_sql(as.numeric(myVar))\r\n```\r\n<SQL> CAST(\"myVar\" AS NUMERIC)\r\n\r\nHow do I fix this issue and get started adding support for Vertica?\r\nThanks!\r\n\r\n> We’re working to add support for more databases over time, but adding support on your own is surprisingly easy. Submit an issue to dplyr and we’ll help you get started.\r\n[https://blog.rstudio.com/2017/06/27/dbplyr-1-1-0/](uhttps://blog.rstudio.com/2017/06/27/dbplyr-1-1-0/)"},"comment":{"url":"https://api.github.com/repos/tidyverse/dplyr/issues/comments/370956983","html_url":"https://github.com/tidyverse/dplyr/issues/3236#issuecomment-370956983","issue_url":"https://api.github.com/repos/tidyverse/dplyr/issues/3236","id":370956983,"user":{"login":"edgararuiz","id":7875923,"avatar_url":"https://avatars1.githubusercontent.com/u/7875923?v=4","gravatar_id":"","url":"https://api.github.com/users/edgararuiz","html_url":"https://github.com/edgararuiz","followers_url":"https://api.github.com/users/edgararuiz/followers","following_url":"https://api.github.com/users/edgararuiz/following{/other_user}","gists_url":"https://api.github.com/users/edgararuiz/gists{/gist_id}","starred_url":"https://api.github.com/users/edgararuiz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edgararuiz/subscriptions","organizations_url":"https://api.github.com/users/edgararuiz/orgs","repos_url":"https://api.github.com/users/edgararuiz/repos","events_url":"https://api.github.com/users/edgararuiz/events{/privacy}","received_events_url":"https://api.github.com/users/edgararuiz/received_events","type":"User","site_admin":false},"created_at":"2018-03-06T22:47:35Z","updated_at":"2018-03-06T22:47:35Z","author_association":"NONE","body":"Right, you can remove that step in your custom write and create tables?"}}
{"actor":{"display_login":"edgararuiz"}}