I have a very large pyspark dataframe and a smaller pandas dataframe which I read in as follows:
df1 = spark.read.csv("/user/me/data1/")
df2 = pd.read_csv("data2.csv")
Both dataframes include columns labelled "A" and "B". I would like to create another pyspark dataframe with only those rows from df1 where the entries in columns "A" and "B" occur in those columns with the same name in df2. That is to filter df1 using columns "A" and "B" of df2.
Normally I think this would be a join (implemented with
merge) but how do you join a pandas dataframe with a pyspark one?
I can't afford to convert df1 to a pandas dataframe.