Created
March 21, 2017 20:54
-
-
Save edgararuiz-zz/a32f304662755f5870c498f1ca1499ea to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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