join {SparkR} | R Documentation |
Join two SparkDataFrames based on the given join expression.
## S4 method for signature 'SparkDataFrame,SparkDataFrame' join(x, y, joinExpr = NULL, joinType = NULL)
x |
A SparkDataFrame |
y |
A SparkDataFrame |
joinExpr |
(Optional) The expression used to perform the join. joinExpr must be a Column expression. If joinExpr is omitted, join() will perform a Cartesian join |
joinType |
The type of join to perform. The following join types are available: 'inner', 'outer', 'full', 'fullouter', leftouter', 'left_outer', 'left', 'right_outer', 'rightouter', 'right', and 'leftsemi'. The default joinType is "inner". |
A SparkDataFrame containing the result of the join operation.
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
,
insertInto
, intersect
,
isLocal
, 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
## Not run:
##D sc <- sparkR.init()
##D sqlContext <- sparkRSQL.init(sc)
##D df1 <- read.json(sqlContext, path)
##D df2 <- read.json(sqlContext, path2)
##D join(df1, df2) # Performs a Cartesian
##D join(df1, df2, df1$col1 == df2$col2) # Performs an inner join based on expression
##D join(df1, df2, df1$col1 == df2$col2, "right_outer")
## End(Not run)