imback82 commented on a change in pull request #28676: URL: https://github.com/apache/spark/pull/28676#discussion_r432808970
########## File path: sql/core/src/test/scala/org/apache/spark/sql/execution/adaptive/AdaptiveQueryExecSuite.scala ########## @@ -540,17 +540,20 @@ class AdaptiveQueryExecSuite } test("Avoid plan change if cost is greater") { + val testData2 = spark.table("testData2") + val newTestData2 = testData2.withColumn("c", testData2("a")) + newTestData2.createTempView("newTestData2") val origPlan = sql("SELECT * FROM testData " + - "join testData2 t2 ON key = t2.a " + - "join testData2 t3 on t2.a = t3.a where t2.b = 1").queryExecution.executedPlan + "join newTestData2 t2 ON key = t2.a " + + "join testData2 t3 on t2.c = t3.a where t2.b = 1").queryExecution.executedPlan withSQLConf( SQLConf.ADAPTIVE_EXECUTION_ENABLED.key -> "true", - SQLConf.AUTO_BROADCASTJOIN_THRESHOLD.key -> "80") { + SQLConf.AUTO_BROADCASTJOIN_THRESHOLD.key -> "100") { val (plan, adaptivePlan) = runAdaptiveAndVerifyResult( "SELECT * FROM testData " + - "join testData2 t2 ON key = t2.a " + - "join testData2 t3 on t2.a = t3.a where t2.b = 1") + "join newTestData2 t2 ON key = t2.a " + + "join testData2 t3 on t2.c = t3.a where t2.b = 1") Review comment: With the `BroadcastHashJoinExec` change, shuffle is no longer introduced, so cost is better, thus SMJ is changed to BHJ. So, I introduced a new column and reference that column as a join key to keep the existing behavior. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org