File tree Expand file tree Collapse file tree
sql/core/src/test/scala/org/apache/spark/sql/execution Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -113,6 +113,23 @@ class BroadcastExchangeSuite extends SparkPlanTest
113113 broadcastExchangeNode.resetMetrics()
114114 assert(metrics(" numOutputRows" ).value == 1 )
115115 }
116+
117+ test(" SPARK-56455: maxBroadcastTableSize config enforcement" ) {
118+ withSQLConf(SQLConf .MAX_BROADCAST_TABLE_SIZE .key -> " 104857600" ) {
119+ val df = spark.range(100 ).toDF()
120+ val joinDF = df.join(broadcast(df), " id" )
121+ assert(joinDF.collect().length == 100 )
122+ }
123+
124+ withSQLConf(SQLConf .MAX_BROADCAST_TABLE_SIZE .key -> " 100" ) {
125+ val df = spark.range(1000 ).toDF()
126+ val joinDF = df.join(broadcast(df), " id" )
127+ val ex = intercept[SparkException ] {
128+ joinDF.collect()
129+ }
130+ assert(ex.getCondition == " _LEGACY_ERROR_TEMP_2249" )
131+ }
132+ }
116133}
117134
118135// Additional tests run in 'local-cluster' mode.
You can’t perform that action at this time.
0 commit comments