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_r394920011
##########
File path:
sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/analysis/ResolveHintsSuite.scala
##########
@@ -241,4 +241,52 @@ class ResolveHintsSuite extends AnalysisTest {
Project(testRelation.output, testRelation),
caseSensitive = false)
}
+
+ test("Supports multi-part table names for broadcast hint resolution") {
+ // local temp table (single-part identifier case)
+ checkAnalysis(
+ UnresolvedHint("MAPJOIN", Seq("table", "table2"),
+ table("table").join(table("table2"))),
+ Join(
+ ResolvedHint(testRelation, HintInfo(strategy = Some(BROADCAST))),
+ ResolvedHint(testRelation2, HintInfo(strategy = Some(BROADCAST))),
+ Inner,
+ None,
+ JoinHint.NONE),
+ caseSensitive = false)
+
+ checkAnalysis(
+ UnresolvedHint("MAPJOIN", Seq("TaBlE", "table2"),
+ table("TaBlE").join(table("TaBlE2"))),
+ Join(
+ ResolvedHint(testRelation, HintInfo(strategy = Some(BROADCAST))),
+ testRelation2,
+ Inner,
+ None,
+ JoinHint.NONE),
+ caseSensitive = true)
+
+ // global temp table (multi-part identifier case)
+ checkAnalysis(
+ UnresolvedHint("MAPJOIN", Seq("global_temp.table4",
"GlOBal_TeMP.table5"),
Review comment:
shall we test `table5` instead of `GlOBal_TeMP.table5`? To verify that we
only check the tail.
----------------------------------------------------------------
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]