intersect {SparkR}R Documentation

Intersect

Description

Return a new SparkDataFrame containing rows only in both this SparkDataFrame and another SparkDataFrame. This is equivalent to 'INTERSECT' in SQL.

Usage

intersect(x, y)

## S4 method for signature 'SparkDataFrame,SparkDataFrame'
intersect(x, y)

Arguments

x

A SparkDataFrame

y

A SparkDataFrame

Value

A SparkDataFrame containing the result of the intersect.

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, insertInto, 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 df1 <- read.json(sqlContext, path)
##D df2 <- read.json(sqlContext, path2)
##D intersectDF <- intersect(df, df2)
## End(Not run)

[Package SparkR version 2.0.0 Index]