Skip to content

Commit 0546825

Browse files
committed
Add test coverage for maxBroadcastTableSize config enforcement
1 parent c3473e4 commit 0546825

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

sql/core/src/test/scala/org/apache/spark/sql/execution/BroadcastExchangeSuite.scala

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,17 @@ class BroadcastExchangeSuite extends SparkPlanTest
113113
broadcastExchangeNode.resetMetrics()
114114
assert(metrics("numOutputRows").value == 1)
115115
}
116+
117+
test("SPARK-56455: broadcast should fail when table size exceeds maxBroadcastTableSize") {
118+
withSQLConf(SQLConf.MAX_BROADCAST_TABLE_SIZE.key -> "100") {
119+
val df = spark.range(1000).toDF()
120+
val joinDF = df.join(broadcast(df), "id")
121+
val ex = intercept[SparkException] {
122+
joinDF.collect()
123+
}
124+
assert(ex.getCondition == "_LEGACY_ERROR_TEMP_2249")
125+
}
126+
}
116127
}
117128

118129
// Additional tests run in 'local-cluster' mode.

0 commit comments

Comments
 (0)