write_df_to_hive3: Write a Dataframe to Hive 3

View source: R/write_df_to_hive3.R

write_df_to_hive3R Documentation

Write a Dataframe to Hive 3

Description

Write a Dataframe to Hive 3

Usage

write_df_to_hive3(df, id, schema, table, server, append_data = FALSE)

Arguments

df

must be a dataframe/tibble

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 an R dataframe to the edge node as a CSV, 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)

df <- as.data.frame(Seatbelts)
id <- 'XXXXX'
server <- 'edge.hadoop.co.com'
schema <- 'schema'
table <- 'table'
write_df_to_hive3(df =
                   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.