我正在尝试运行广播连接,但出现以下错误:
Caused by: org.apache.spark.SparkException: Cannot broadcast the table over 357913941 rows: 480202810 rows.
此处设置spark源代码中的最大行数:
代码如下:
right_df = right_df.withColumn("new_col", F.to_timestamp("date") + F.expr("INTERVAL 30 minutes")*F.col('period'))
join_condition = [right_df.col_0 == left_df.col_0,
right_df.col_1 == left_df.col_1,
right_df.col_2 == left_df.col_2,
right_df.col_3 == left_df.col_3,
right_df.time_point.between(left_df.interval_start, left_df.interval_end)]
df = left_df.join(F.broadcast(right_df), on=join_condition, how='left')
我的right_df
数据帧只有1,7GB,小于限制8GB。
我已将spark.sql.autoBroadcastJoinThreshold
设置为8GB:
value = 8*10**9
spark.conf.set("spark.sql.autoBroadcastJoinThreshold", f'{value}')
设置:Databricks运行时版本7.5(包括Apache Spark 3.0.1、Scala 2.12)
目前没有回答
相关问题 更多 >
编程相关推荐