Write a CSV file to Hive
write_csv_to_hive(csv_file, id, server, schema_table, append_data = FALSE)
path to CSV file to upload, if only the name of file is provided, then it is assumed the file is in the current working directory reported by getwd(); see dplyr::read_csv documentation for further information.
string ID of user. Password will be requested from the user at function call.
string server extention or path
string "schema.table" Name of the table to write to in Hive.
logical, defaults to FALSE for overwrite; TRUE appends the to the data.
Does not return anything.
Uploads a CSV file and uploads it to Hive. This assumes that when you log into Hive/Hadoop, the login is similar to `XXXXX@edge.hadoop.co.com``
if (FALSE) {
library(ssh)
library(dplyr)
library(readr)
library(askpass)
library(magrittr)
df <- mtcars
zid <- 'XXXXX'
server <- 'edge.hadoop.co.com'
schema_table <- 'schema.table'
file <- c('table_for_hive.csv')
write_csv_to_hive(csv_file = file, id = zid, server = server, schema_table = schema_table)
}