Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix
  • Loading branch information
maropu committed Feb 13, 2019
commit 59e60d43a68e0641fa5a66028bd5dcc01d5b0804
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ trait AnalysisTest extends PlanTest {
catalog.createTempView("TaBlE", TestRelations.testRelation, overrideIfExists = true)
catalog.createTempView("TaBlE2", TestRelations.testRelation2, overrideIfExists = true)
catalog.createTempView("TaBlE3", TestRelations.testRelation3, overrideIfExists = true)
catalog.createGlobalTempView("TaBlE4", TestRelations.testRelation4, overrideIfExists = true)
catalog.createGlobalTempView("TaBlE5", TestRelations.testRelation5, overrideIfExists = true)
new Analyzer(catalog, conf) {
override val extendedResolutionRules = EliminateSubqueryAliases :: Nil
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,17 +157,32 @@ class ResolveHintsSuite extends AnalysisTest {
}

test("Supports multi-part table names for broadcast hint resolution") {
// local temp table
checkAnalysis(
UnresolvedHint("MAPJOIN", Seq("default.table", "default.table2"),
UnresolvedHint("MAPJOIN", Seq("table", "table2"),
table("table").join(table("table2"))),
Join(ResolvedHint(testRelation, HintInfo(broadcast = true)),
ResolvedHint(testRelation2, HintInfo(broadcast = true)), Inner, None),
caseSensitive = false)

checkAnalysis(
UnresolvedHint("MAPJOIN", Seq("default.TaBlE", "default.table2", "DEfault.TaBlE2"),
UnresolvedHint("MAPJOIN", Seq("TaBlE", "table2"),
table("TaBlE").join(table("TaBlE2"))),
Join(ResolvedHint(testRelation, HintInfo(broadcast = true)), testRelation2, Inner, None),
caseSensitive = true)

// global temp table
checkAnalysis(
UnresolvedHint("MAPJOIN", Seq("global_temp.table4", "GlOBal_TeMP.table5"),
table("global_temp", "table4").join(table("global_temp", "table5"))),
Join(ResolvedHint(testRelation4, HintInfo(broadcast = true)),
ResolvedHint(testRelation5, HintInfo(broadcast = true)), Inner, None),
caseSensitive = false)

checkAnalysis(
UnresolvedHint("MAPJOIN", Seq("global_temp.TaBlE4", "table5"),
table("global_temp", "TaBlE4").join(table("global_temp", "TaBlE5"))),
Join(ResolvedHint(testRelation4, HintInfo(broadcast = true)), testRelation5, Inner, None),
caseSensitive = true)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ object TestRelations {
AttributeReference("g", StringType)(),
AttributeReference("h", MapType(IntegerType, IntegerType))())

val testRelation5 = LocalRelation(AttributeReference("i", StringType)())

val nestedRelation = LocalRelation(
AttributeReference("top", StructType(
StructField("duplicateField", StringType) ::
Expand Down