Skip to content

Commit

Permalink
change style
Browse files Browse the repository at this point in the history
  • Loading branch information
wangxiaojing committed Dec 23, 2014
1 parent fbe4887 commit f103983
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
7 changes: 4 additions & 3 deletions sql/core/src/test/scala/org/apache/spark/sql/JoinSuite.scala
Original file line number Diff line number Diff line change
Expand Up @@ -389,14 +389,15 @@ class JoinSuite extends QueryTest with BeforeAndAfterEach {
sql("CACHE TABLE testData")
val tmp = autoBroadcastJoinThreshold

sql( s"""SET ${SQLConf.AUTO_BROADCASTJOIN_THRESHOLD}=1000000000""")
sql(s"SET ${SQLConf.AUTO_BROADCASTJOIN_THRESHOLD}=1000000000")
Seq(
("SELECT * FROM testData LEFT SEMI JOIN testData2 ON key = a", classOf[BroadcastLeftSemiJoinHash])
("SELECT * FROM testData LEFT SEMI JOIN testData2 ON key = a",
classOf[BroadcastLeftSemiJoinHash])
).foreach {
case (query, joinClass) => assertJoin(query, joinClass)
}

sql( s"""SET ${SQLConf.AUTO_BROADCASTJOIN_THRESHOLD}=-1""")
sql(s"SET ${SQLConf.AUTO_BROADCASTJOIN_THRESHOLD}=-1")

Seq(
("SELECT * FROM testData LEFT SEMI JOIN testData2 ON key = a", classOf[LeftSemiJoinHash])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,9 @@ class StatisticsSuite extends QueryTest with BeforeAndAfterAll {

// Assert src has a size smaller than the threshold.
val sizes = rdd.queryExecution.analyzed.collect {
case r if implicitly[ClassTag[MetastoreRelation]].runtimeClass.isAssignableFrom(r.getClass) => r.statistics.sizeInBytes
case r if implicitly[ClassTag[MetastoreRelation]].runtimeClass
.isAssignableFrom(r.getClass) =>
r.statistics.sizeInBytes
}
assert(sizes.size === 2 && sizes(1) <= autoBroadcastJoinThreshold
&& sizes(0) <= autoBroadcastJoinThreshold,
Expand All @@ -223,7 +225,7 @@ class StatisticsSuite extends QueryTest with BeforeAndAfterAll {
TestHive.settings.synchronized {
val tmp = autoBroadcastJoinThreshold

sql( s"""SET ${SQLConf.AUTO_BROADCASTJOIN_THRESHOLD}=-1""")
sql(s"SET ${SQLConf.AUTO_BROADCASTJOIN_THRESHOLD}=-1")
rdd = sql(leftSemiJoinQuery)
bhj = rdd.queryExecution.sparkPlan.collect {
case j: BroadcastLeftSemiJoinHash => j
Expand All @@ -236,7 +238,7 @@ class StatisticsSuite extends QueryTest with BeforeAndAfterAll {
assert(shj.size === 1,
"LeftSemiJoinHash should be planned when BroadcastHashJoin is turned off")

sql( s"""SET ${SQLConf.AUTO_BROADCASTJOIN_THRESHOLD}=$tmp""")
sql(s"SET ${SQLConf.AUTO_BROADCASTJOIN_THRESHOLD}=$tmp")
}

}
Expand Down

0 comments on commit f103983

Please sign in to comment.