Skip to content

Instantly share code, notes, and snippets.

@edgararuiz-zz
Created March 21, 2017 20:54
Show Gist options
  • Save edgararuiz-zz/a32f304662755f5870c498f1ca1499ea to your computer and use it in GitHub Desktop.
Save edgararuiz-zz/a32f304662755f5870c498f1ca1499ea to your computer and use it in GitHub Desktop.
devtools::install_github("rstats-db/odbc", ref = "transactions", force = TRUE)
library(odbc)
odbcHiveCon <- dbConnect(odbc(),
Driver = "Hive Driver",
host = "ec2-52-35-222-37.us-west-2.compute.amazonaws.com",
Schema = "default",
UID = "rstudio",
PWD = "rstudio",
port = 10000)
dbListTables(odbcHiveCon)
dbGetQuery(odbcHiveCon, "Select * from customers limit 10")
dbWriteTable(odbcHiveCon, "mtcars_hive", mtcars, overwrite = TRUE)
dbReadTable(odbcHiveCon, "mtcars_hive")
dbRemoveTable(odbcHiveCon, "mtcars_hive")
dbListTables(odbcHiveCon)
dbDisconnect(odbcHiveCon)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment