insertInto {SparkR}R Documentation

insertInto

Description

Insert the contents of a SparkDataFrame into a table registered in the current SQL Context.

Usage

insertInto(x, tableName, ...)

## S4 method for signature 'SparkDataFrame,character'
insertInto(x, tableName,
  overwrite = FALSE)

Arguments

x

A SparkDataFrame

tableName

A character vector containing the name of the table

overwrite

A logical argument indicating whether or not to overwrite the existing rows in the table.

See Also

Other SparkDataFrame functions: SparkDataFrame-class, [[, agg, arrange, as.data.frame, attach, cache, collect, colnames, coltypes, columns, count, dapply, describe, dim, distinct, dropDuplicates, dropna, drop, dtypes, except, explain, filter, first, group_by, head, histogram, intersect, isLocal, join, limit, merge, mutate, ncol, persist, printSchema, registerTempTable, rename, repartition, sample, saveAsTable, selectExpr, select, showDF, show, str, take, unionAll, unpersist, withColumn, write.df, write.jdbc, write.json, write.parquet, write.text

Examples

## Not run: 
##D sc <- sparkR.init()
##D sqlContext <- sparkRSQL.init(sc)
##D df <- read.df(sqlContext, path, "parquet")
##D df2 <- read.df(sqlContext, path2, "parquet")
##D registerTempTable(df, "table1")
##D insertInto(df2, "table1", overwrite = TRUE)
## End(Not run)

[Package SparkR version 2.0.0 Index]