QuestionQ53
VerifiedTroubleshooting and Tuning Apache Spark DataFrame API Applications.An engineer has two DataFrames, df1 and df2, where df1 is small and df2 is large. To optimize the join, the engineer uses a broadcast join:
from pyspark.sql.functions import broadcast
result = df2.join(broadcast(df1), on='id', how='inner')
What is the purpose of using broadcast() in this scenario?
Community Discussion