1

In SQL we are able to select entries from a TABLE A based on a column in TABLE B.

Please see below:

SELECT * FROM TABLE A 
WHERE NAME in (SELECT NAME FROM TABLE B)

How do I replicate this piece of code in pyspark without using a sql context?

Michael Szczesny
  • 4,911
  • 5
  • 15
  • 32
ns_15
  • 11
  • 2
  • 2
    Does this answer your question? [PySpark: match the values of a DataFrame column against another DataFrame column](https://stackoverflow.com/questions/42545788/pyspark-match-the-values-of-a-dataframe-column-against-another-dataframe-column) – polkas Oct 11 '20 at 17:48

1 Answers1

0

Df=A.join(B, on =['Name'], how ='inner' ).select(A.columns)