Write a CSV file to Hive 3
write_csv_to_hive3(
csv_name,
csv_folder = ".",
id,
schema,
table,
server,
append_data = FALSE
)
string name of the file with .csv extension
string path to folder where CSV file is stored. Defaults to current working directory represented by ".". Do not place a "/" at the end of the path.
string ID of user. Password will be requested at function call.
string schema name in hive
string name for the table in hive. One will be created if not exists.
string server extention or path
logical, defaults to FALSE for overwrite; TRUE appends the to the data.
Does not return anything.
Uploads a CSV file to the edge node, uploads it to Hive, and creates
a managed table. The function also cleans up the csv file on the edge node
and in the users' hdfs home location. 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)
csv_name <- 'file.csv'
csv_folder <- getwd()
id <- 'XXXXX'
server <- 'edge.hadoop.co.com'
schema <- 'schema'
table <- 'table'
write_csv_to_hive3(csv_name = csv_name,
csv_folder = csv_folder,
id = id,
schema = schema,
table = table,
server = server,
append_data = FALSE)
}