cloud-fan commented on a change in pull request #27935: [SPARK-25121][SQL]
Supports multi-part table names for broadcast hint resolution
URL: https://github.com/apache/spark/pull/27935#discussion_r394922104
##########
File path:
sql/core/src/test/scala/org/apache/spark/sql/DataFrameJoinSuite.scala
##########
@@ -322,4 +325,81 @@ class DataFrameJoinSuite extends QueryTest
}
}
}
+
+ test("Supports multi-part names for broadcast hint resolution") {
+ val (table1Name, table2Name) = ("t1", "t2")
+
+ withTempDatabase { dbName =>
+ withTable(table1Name, table2Name) {
+ withSQLConf(SQLConf.AUTO_BROADCASTJOIN_THRESHOLD.key -> "-1") {
+ spark.range(50).write.saveAsTable(s"$dbName.$table1Name")
+ spark.range(100).write.saveAsTable(s"$dbName.$table2Name")
+
+ // First, makes sure a join is not broadcastable
+ val plan = sql(s"SELECT * FROM $dbName.$table1Name,
$dbName.$table2Name " +
+ s"WHERE $table1Name.id = $table2Name.id")
+ .queryExecution.executedPlan
+ assert(plan.collect { case p: BroadcastHashJoinExec => p }.isEmpty)
+
+ def checkIfHintApplied(tableName: String, hintTableName: String):
Unit = {
Review comment:
cann we test DataFrame hint API as well?
----------------------------------------------------------------
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:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]