join,DataFrame,DataFrame-method {SparkR} | R Documentation |
Join two DataFrames based on the given join expression.
## S4 method for signature 'DataFrame,DataFrame' join(x, y, joinExpr = NULL, joinType = NULL)
x |
A Spark DataFrame |
y |
A Spark DataFrame |
joinExpr |
(Optional) The expression used to perform the join. joinExpr must be a Column expression. If joinExpr is omitted, join() wil perform a Cartesian join |
joinType |
The type of join to perform. The following join types are available: 'inner', 'outer', 'left_outer', 'right_outer', 'semijoin'. The default joinType is "inner". |
A DataFrame containing the result of the join operation.
## Not run:
##D sc <- sparkR.init()
##D sqlContext <- sparkRSQL.init(sc)
##D df1 <- jsonFile(sqlContext, path)
##D df2 <- jsonFile(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)