write_csv_to_hive3: Write a CSV file to Hive 3

View source: R/write_csv_to_hive3.R

write_csv_to_hive3R Documentation

Write a CSV file to Hive 3

Description

Write a CSV file to Hive 3

Usage

write_csv_to_hive3(
  csv_name,
  csv_folder = ".",
  id,
  schema,
  table,
  server,
  append_data = FALSE
)

Arguments

csv_name

string name of the file with .csv extension

csv_folder

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.

id

string ID of user. Password will be requested at function call.

schema

string schema name in hive

table

string name for the table in hive. One will be created if not exists.

server

string server extention or path

append_data

logical, defaults to FALSE for overwrite; TRUE appends the to the data.

Details

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

Value

Does not return anything.

Examples

## Not run: 
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)

## End(Not run)


Fredo-XVII/RToolShed documentation built on March 17, 2024, 12:15 p.m.